Make php_self() more robust. Seems to fix certain lighttpd issues, such as probably...
[squirrelmail.git] / src / view_header.php
index fd43a16af92ebd5ad165e1af049ef2c674dba0e8..9c924a3d4e1e1b990b642104c3f1efea038577a6 100644 (file)
@@ -5,7 +5,7 @@
  *
  * This is the code to view the message header.
  *
- * @copyright © 1999-2009 The SquirrelMail Project Team
+ * @copyright 1999-2009 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -41,16 +41,17 @@ function parse_viewheader($imapConnection,$id, $passed_ent_id) {
     for ($i=1; $i < count($read); $i++) {
         $line = htmlspecialchars($read[$i]);
         switch (true) {
-            case (eregi("^&gt;", $line)):
+            case (preg_match('/^&gt;/i', $line)):
                 $second[$i] = $line;
                 $first[$i] = '&nbsp;';
                 $cnum++;
                 break;
-            case (eregi("^[ |\t]", $line)):
+// FIXME: is the pipe character below a mistake?  I think the original author might have thought it carried special meaning in the character class, which it does not... but then again, I am not currently trying to understand what this code actually does
+            case (preg_match('/^[ |\t]/', $line)):
                 $second[$i] = $line;
                 $first[$i] = '';
                 break;
-            case (eregi("^([^:]+):(.+)", $line, $regs)):
+            case (preg_match('/^([^:]+):(.+)/', $line, $regs)):
                 $first[$i] = $regs[1] . ':';
                 $second[$i] = $regs[2];
                 $cnum++;