Remove Horde_Browser::escapeJSCode()
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 29 Jul 2010 16:24:25 +0000 (10:24 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 29 Jul 2010 17:27:58 +0000 (11:27 -0600)
This is handled by json encoding now.

framework/Browser/lib/Horde/Browser.php
framework/Browser/package.xml

index a1ddf24..1e7f435 100644 (file)
@@ -1194,32 +1194,6 @@ class Horde_Browser
     }
 
     /**
-     * Escapes characters in javascript code if the browser requires it.  %23,
-     * %26, and %2B (for some browsers) and %27 need to be escaped or else
-     * javascript will interpret it as a single quote, pound sign, or
-     * ampersand and refuse to work.
-     *
-     * @param string $code  The JS code to escape.
-     *
-     * @return string  The escaped code.
-     */
-    public function escapeJSCode($code)
-    {
-        $from = $to = array();
-
-        if ($this->isBrowser('msie') ||
-            ($this->isBrowser('mozilla') && ($this->getMajor() >= 5)) ||
-            $this->isBrowser('konqueror')) {
-            $from = array('%23', '%26', '%2B');
-            $to = array('%2523', '%2526', '%252B');
-        }
-        $from[] = '%27';
-        $to[] = '\%27';
-
-        return str_replace($from, $to, $code);
-    }
-
-    /**
      * Sets the IE version in the session.
      *
      * @param string $ver  The IE Version string.
index 6678e5e..2bf4b7e 100644 (file)
@@ -25,7 +25,8 @@ about the current user&apos;s browser and its capabilities.
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Add Horde_Browser_Exception::.
+ <notes>* Remove Horde_Browser::escapeJSCode().
+ * Add Horde_Browser_Exception::.
  * Initial Horde 4 package.</notes>
  <contents>
   <dir name="/">