Optimization:
[squirrelmail.git] / src / options_highlight.php
index 0775e2e848b5a24ca6607387ae79e5344b52c56e..ceebe2f46c858edc92bb33a6b7747c7e33248888 100644 (file)
@@ -16,6 +16,7 @@ require_once('../functions/display_messages.php');
 require_once('../functions/imap.php');
 require_once('../functions/array.php');
 require_once('../functions/plugin.php');
+require_once('../functions/strings.php');
 
 function oh_opt( $val, $sel, $tit ) {
     echo "<option value=\"$val\"";
@@ -33,20 +34,20 @@ if (! isset($message_highlight_list)) {
 
 if ($action == 'delete' && isset($theid)) {
     removePref($data_dir, $username, "highlight$theid");
-    header( "Location: $PHP_SELF" );
+    header( "Location: $SCRIPT_NAME" );
     exit;
 } else if ($action == 'save') {
     if (!$theid) $theid = 0;
-    $identname = ereg_replace(',', ' ', $identname);
+    $identname = str_replace(',', ' ', $identname);
     if ($color_type == 1) $newcolor = $newcolor_choose;
     elseif ($color_type == 2) $newcolor = $newcolor_input;
     else $newcolor = $color_type;
 
-    $newcolor = ereg_replace(',', '', $newcolor);
-    $newcolor = ereg_replace('#', '', $newcolor);
-    $newcolor = ereg_replace('"', '', $newcolor);
-    $newcolor = ereg_replace('\'', '', $newcolor);
-    $value = ereg_replace(',', ' ', $value);
+    $newcolor = str_replace(',', '', $newcolor);
+    $newcolor = str_replace('#', '', $newcolor);
+    $newcolor = str_replace('"', '', $newcolor);
+    $newcolor = str_replace('\'', '', $newcolor);
+    $value = str_replace(',', ' ', $value);
 
     setPref($data_dir, $username, "highlight$theid", $identname.','.$newcolor.','.$value.','.$match_type);
     $message_highlight_list[$theid]['name'] = $identname;
@@ -69,9 +70,9 @@ if (count($message_highlight_list) >= 1) {
     for ($i=0; $i < count($message_highlight_list); $i++) {
         echo '<tr bgcolor="' . $message_highlight_list[$i]['color'] . '">'.
                 "<td width=\"20%\" bgcolor=\"$color[4]\" nowrap>".
-                "<small>[<a href=\"options_highlight.php?action=edit&theid=$i\">".
+                "<small>[<a href=\"options_highlight.php?action=edit&amp;theid=$i\">".
             _("Edit") .
-            '</a>]&nbsp;[<a href="options_highlight.php?action=delete&theid='.
+            '</a>]&nbsp;[<a href="options_highlight.php?action=delete&amp;theid='.
             $i . '">' . _("Delete") . '</a>]</small>'.
             '</td><td>'.
             htmlspecialchars($message_highlight_list[$i]['name']) .