Переглянути джерело

disable regexp compilation error

tokul 19 роки тому
батько
коміт
bb2302ba12
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      functions/abook_local_file.php

+ 6 - 1
functions/abook_local_file.php

@@ -276,7 +276,12 @@ class abook_local_file extends addressbook_backend {
 
 
         while ($row = @fgetcsv($this->filehandle, 2048, '|')) {
         while ($row = @fgetcsv($this->filehandle, 2048, '|')) {
             $line = join(' ', $row);
             $line = join(' ', $row);
-            if(eregi($expr, $line)) {
+            /**
+             * TODO: regexp search is supported only in local_file backend.
+             * Do we check format of regexp or ignore errors?
+             */
+            // errors on eregi call are suppressed in order to prevent display of regexp compilation errors
+            if(@eregi($expr, $line)) {
                 array_push($res, array('nickname'  => $row[0],
                 array_push($res, array('nickname'  => $row[0],
                     'name'      => $row[1] . ' ' . $row[2],
                     'name'      => $row[1] . ' ' . $row[2],
                     'firstname' => $row[1],
                     'firstname' => $row[1],