Commit e43d3d5955f6a904876512421f29cf3c0dc140c9

Authored by Nathanaël Jourdane
1 parent a525e8c1

Fix errors when importing files with tabs

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
php/classes/FilesMgr.php
... ... @@ -260,8 +260,8 @@ class FilesMgr extends AmdaObjectMgr
260 260 $handler = fopen($this->fileName, 'r');
261 261 if ($handler) {
262 262 while (!feof($handler) && !$StartTime) {
263   - $oneLine = trim(fgets($handler));
264   - $elems = explode(" ", preg_replace('/\s+/', ' ', $oneLine));
  263 + $oneLine = trim(preg_replace('/\s+/', ' ', fgets($handler)));
  264 + $elems = explode(' ', $oneLine);
265 265 if ((strlen($elems[0]) < 16) || !($time = strtotime($elems[0]))) {
266 266 $i++;
267 267 continue;
... ... @@ -274,7 +274,8 @@ class FilesMgr extends AmdaObjectMgr
274 274  
275 275 if (feof($handler)) return -10;
276 276  
277   - $oneLine = trim(fgets($handler));
  277 + $oneLine = trim(preg_replace('/\s+/', ' ', fgets($handler)));
  278 +
278 279 $elems = explode(" ",$oneLine);
279 280 if (count($elems) < 2) return -10;
280 281  
... ...