fixed some quoting problems in searching and message highlighting
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 3 Aug 2000 10:38:43 +0000 (10:38 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 3 Aug 2000 10:38:43 +0000 (10:38 +0000)
form submissions

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@671 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/options_highlight.php
src/search.php

index 1a4a8fcb09e14ad1465c636e308a2cf4164edcd8..8529ab6ac04137993ff4417e83b4973b4eecd889 100644 (file)
@@ -32,6 +32,9 @@
    } else if ($action == "save") {
       if (!$theid) $theid = 0;
       $identname = ereg_replace(",", " ", $identname);
+      $identname = str_replace("\\\\", "\\", $identname);
+      $identname = str_replace("\\\"", "\"", $identname);
+      $identname = str_replace("\"", "&quot;", $identname);
       if ($color_type == 1) $newcolor = $newcolor_choose;
       else $newcolor = $newcolor_input;
  
       $newcolor = ereg_replace("#", "", $newcolor);
       $newcolor = "$newcolor";
       $value = ereg_replace(",", " ", $value);
+      $value = str_replace("\\\\", "\\", $value);
+      $value = str_replace("\\\"", "\"", $value);
+      $value = str_replace("\"", "&quot;", $value);
+
       setPref($data_dir, $username, "highlight$theid", $identname.",".$newcolor.",".$value.",".$match_type);
       $message_highlight_list[$theid]["name"] = $identname;
       $message_highlight_list[$theid]["color"] = $newcolor;
       echo _("Identifying name") . ":";
       echo "      </b></td>\n";
       echo "      <td width=75%>\n";
-      echo "         <input type=\"text\" value=\"".$message_highlight_list[$theid]["name"]."\" name=\"identname\">";
+      $disp = $message_highlight_list[$theid]["name"];
+      $disp = str_replace("\\\\", "\\", $disp);
+      $disp = str_replace("\\\"", "\"", $disp);
+      $disp = str_replace("\"", "&quot;", $disp);
+      echo "         <input type=\"text\" value=\"".$disp."\" name=\"identname\">";
       echo "      </td>\n";
       echo "   </tr>\n";
       echo "   <tr><td><small><small>&nbsp;</small></small></td></tr>\n";
       if ($message_highlight_list[$theid]["match_type"] == "subject") echo "            <option value=\"subject\" selected>Subject\n";
       else                                                         echo "            <option value=\"subject\">Subject\n";
       echo "         </select>\n";
-      echo "         <nobr><input type=\"text\" value=\"".$message_highlight_list[$theid]["value"]."\" name=\"value\">";
+      $disp = $message_highlight_list[$theid]["value"];
+      $disp = str_replace("\\\\", "\\", $disp);
+      $disp = str_replace("\\\"", "\"", $disp);
+      $disp = str_replace("\"", "&quot;", $disp);
+      echo "         <nobr><input type=\"text\" value=\"".$disp."\" name=\"value\">";
       echo "        <nobr></td>\n";
       echo "   </tr>\n";
       echo "</table>\n";
index 137b8fe1a2093372130d922ee94a413e26036c57..2fb69f6da38091833ad80ad12e354b3b9381d01f 100644 (file)
    echo "         </SELECT></SMALL></TT>";
    echo "       </TD>\n";
    echo "        <TD ALIGN=\"CENTER\" WIDTH=33%>\n";
-   echo "          <INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"what\" VALUE=\"$what\">\n";
+   $what_disp = ereg_replace(",", " ", $what);
+   $what_disp = str_replace("\\\\", "\\", $what_disp);
+   $what_disp = str_replace("\\\"", "\"", $what_disp);
+   $what_disp = str_replace("\"", "&quot;", $what_disp);
+   echo "          <INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"what\" VALUE=\"$what_disp\">\n";
    echo "        </TD>";
    echo "       <TD ALIGN=\"RIGHT\" WIDTH=33%>\n";
    echo "         <SELECT NAME=\"where\">";