[foundation-web] Feed the to-be-escaped variable to escape_js_var



commit b2727e6e9b393f7677d8eabb3d9a16cfa3dd7ce8
Author: Tobias Mueller <tobiasmue gnome org>
Date:   Sat Jun 6 16:12:53 2009 +0200

    Feed the to-be-escaped variable to escape_js_var
    
    So it won't return an empty string anymore. The signature of
    escape_js_var is:
     mixed str_replace  ( mixed $search  , mixed $replace  , mixed $subject [, int &$count  ] )
    So we have to give at least three parameters. I wonder why it doesn't
    complain right now...
---
 foundation.gnome.org/vote/vote.wml |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/foundation.gnome.org/vote/vote.wml b/foundation.gnome.org/vote/vote.wml
index 06166af..742241e 100644
--- a/foundation.gnome.org/vote/vote.wml
+++ b/foundation.gnome.org/vote/vote.wml
@@ -108,9 +108,9 @@ cursor: pointer;
 <?php
 
 function escape_js_var($var) {
-    $var = preg_replace("([\\\'\"\/])", "\\$1");
-    $var = str_replace("\n", "\\n");
-    $var = str_replace("\r", "\\r");
+    $var = preg_replace("([\\\'\"\/])", "\\$1", $var);
+    $var = str_replace("\n", "\\n", $var);
+    $var = str_replace("\r", "\\r", $var);
 
     return $var;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]