The branch, master has been updated via 863d8f2e52373f404ba96fa79c406481277764b1 (commit) from 26622d7fdae775bb8ef5e331fec9b2c963024e58 (commit)
- Log ----------------------------------------------------------------- commit 863d8f2e52373f404ba96fa79c406481277764b1 Author: Michal Čihař michal@cihar.com Date: Mon Aug 22 09:06:31 2011 +0200
Support for not escaped js code
-----------------------------------------------------------------------
Summary of changes: libraries/core.lib.php | 4 ++-- libraries/js_escape.lib.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/libraries/core.lib.php b/libraries/core.lib.php index 29d2f43..d1348ed 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -726,9 +726,9 @@ function PMA_AddJSCode($str) * @param mixed $value Value to set, can be either string or array of strings * */ -function PMA_AddJSVar($key, $value) +function PMA_AddJSVar($key, $value, $escape = true) { - PMA_AddJsCode(PMA_getJsValue($key, $value)); + PMA_AddJsCode(PMA_getJsValue($key, $value, $escape)); }
?> diff --git a/libraries/js_escape.lib.php b/libraries/js_escape.lib.php index 87d8855..cb2dbd1 100644 --- a/libraries/js_escape.lib.php +++ b/libraries/js_escape.lib.php @@ -87,10 +87,12 @@ function PMA_formatJsVal($value) * * @return string Javascript code. */ -function PMA_getJsValue($key, $value) +function PMA_getJsValue($key, $value, $escape = true) { $result = $key . ' = '; - if (is_array($value)) { + if (!$escape) { + $result .= $value; + } elseif (is_array($value)) { $result .= '['; foreach ($value as $id => $val) { $result .= PMA_formatJsVal($value) . ",";
hooks/post-receive