Fix incorrect stristr() parameter order
[squirrelmail.git] / functions / strings.php
index 944177d9d1523a3833522df5b89159eadbd0a90e..ca09684ab416c3fc52b147d2affb802e1513883b 100644 (file)
@@ -349,12 +349,12 @@ function sqWordWrap(&$line, $wrap, $charset='') {
         }
     }
 
-    ereg("^([\t >]*)([^\t >].*)?$", $line, $regs);
+    preg_match('/^([\t >]*)([^\t >].*)?$/', $line, $regs);
     $beginning_spaces = $regs[1];
     if (isset($regs[2])) {
         $words = explode(' ', $regs[2]);
     } else {
-        $words = '';
+        $words = array();
     }
 
     $i = 0;