From 22765520ec922241f67d7660cb4070cada9c4bea Mon Sep 17 00:00:00 2001 From: fidian Date: Mon, 21 May 2001 16:06:15 +0000 Subject: [PATCH] * Wasteful str_replaces could have been done with a simple strip_slashes * With validate.php, we already remove slashes * Some code changes to make it hopefully look better git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1395 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/options_highlight.php | 62 +++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/src/options_highlight.php b/src/options_highlight.php index 9adfad5d..8494895a 100644 --- a/src/options_highlight.php +++ b/src/options_highlight.php @@ -26,20 +26,15 @@ } else if ($action == 'save') { if (!$theid) $theid = 0; $identname = ereg_replace(',', ' ', $identname); - $identname = str_replace('\\\\', '\\', $identname); - $identname = str_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 = "$newcolor"; + $newcolor = ereg_replace('"', '', $newcolor); + $newcolor = ereg_replace('\'', '', $newcolor); $value = ereg_replace(',', ' ', $value); - $value = str_replace('\\\\', '\\', $value); - $value = str_replace('\\"', '"', $value); - $value = str_replace('"', '"', $value); setPref($data_dir, $username, "highlight$theid", $identname.','.$newcolor.','.$value.','.$match_type); $message_highlight_list[$theid]['name'] = $identname; @@ -60,17 +55,19 @@ if (count($message_highlight_list) >= 1) { echo ''."\n"; for ($i=0; $i < count($message_highlight_list); $i++) { - echo "\n"; - echo ' '; - echo ' \n"; - echo ' \n"; - echo "\n"; +?> + +\n"; echo "
\n"; @@ -246,26 +243,24 @@ echo '' . "\n"; echo '
\n"; - echo "[" . _("Edit") . "] ["._("Delete")."]\n"; - echo ' \n"; - echo ' ' . $message_highlight_list[$i]['name'] . ' '; - echo " \n"; - echo ' '.$message_highlight_list[$i]['match_type'].' = ' . $message_highlight_list[$i]['value']; - echo "
+ [] [] + + + + +
' . "\n"; echo " \n"; - echo " ' . "\n"; - echo ' \n"; echo " \n"; echo ' ' . "\n"; echo " \n"; - echo ' \n"; - echo ' ' . "\n"; echo " \n"; - echo ' \n"; - echo ' \n"; + $disp = htmlspecialchars($disp); + echo ' '; + echo " \n"; echo " \n"; echo "
\n"; + echo " \n"; echo _("Identifying name") . ":"; echo ' ' . "\n"; + echo ' ' . "\n"; if (isset($message_highlight_list[$theid]['name'])) $disp = $message_highlight_list[$theid]['name']; else $disp = ' '; - $disp = str_replace('\\\\', '\\', $disp); - $disp = str_replace('\\"', '"', $disp); - $disp = str_replace('"', '"', $disp); + $disp = htmlspecialchars($disp); echo " "; echo "
 
' . "\n"; + echo ' ' . "\n"; echo _("Color") . ':'; echo " ' . "\n"; + echo ' ' . "\n"; echo "  
 
' . "\n"; - echo _("Match") . ':'; - echo " ' . "\n"; + echo ' ' . "\n"; echo " \n"; + echo '' . _("Matches") . ': '; if (isset($message_highlight_list[$theid]['value'])) $disp = $message_highlight_list[$theid]['value']; else $disp = ''; - $disp = str_replace('\\\\', '\\', $disp); - $disp = str_replace('\\"', '"', $disp); - $disp = str_replace('"', '"', $disp); - echo ' '; - echo "
\n"; echo '
\n"; echo "\n"; - do_hook('options_highlight_bottom'); } + do_hook('options_highlight_bottom'); ?> -- 2.25.1