From 413a0d9dca965a993333b36e3fe8cdb12a946d31 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Thu, 5 Oct 2006 11:45:34 +0000 Subject: [PATCH] Escape JS specific characters --- docs/NEWS | 2 +- include/functions_config.inc.php | 4 ++-- serendipity_config.inc.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 031b02e..75651f5 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -1,6 +1,6 @@ # $Id$ -Version 1.1-beta4 () +Version 1.1-beta5 () ------------------------------------------------------------------------ * Added new plugin hooks: diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php index 5100765..22822d2 100644 --- a/include/functions_config.inc.php +++ b/include/functions_config.inc.php @@ -542,8 +542,8 @@ function serendipity_restoreVar(&$source, &$target) { * @return null */ function serendipity_JSsetCookie($name, $value) { - $name = str_replace('"', '\"', $name); - $value = str_replace('"', '\"', $value); + $name = strtr($name, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n',''<\/')); + $value = strtr($value, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n',''<\/')); echo '' . "\n"; } diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index ddaf750..ce41230 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -31,7 +31,7 @@ if (IS_installed === true && !defined('IN_serendipity')) { include(S9Y_INCLUDE_PATH . 'include/compat.inc.php'); // The version string -$serendipity['version'] = '1.1-beta4'; +$serendipity['version'] = '1.1-beta5'; // Setting this to 'false' will enable debugging output. All alpa/beta/cvs snapshot versions will emit debug information by default. To increase the debug level (to enable Smarty debugging), set this flag to 'debug'. $serendipity['production'] = (preg_match('@\-(alpha|beta|cvs)@', $serendipity['version']) ? false : true); -- 2.39.5