diff options
author | Andrew <browner12@gmail.com> | 2014-02-17 19:24:00 +0100 |
---|---|---|
committer | Andrew <browner12@gmail.com> | 2014-02-17 19:24:00 +0100 |
commit | 63cb46b94c4dda33e036643fbca3d94e0ba079f0 (patch) | |
tree | a8bc36fa23e3a7de491223c896d9aadaf4e8c408 /system/helpers/url_helper.php | |
parent | b6d8b962e44202a74c9b9321a4a53f61a753fccf (diff) | |
parent | ffe8aded4d2210759fce3427ed04893e6c655006 (diff) |
Merge branch 'develop' into patch-1
Diffstat (limited to 'system/helpers/url_helper.php')
-rw-r--r-- | system/helpers/url_helper.php | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index f9650cd04..5f11a42ca 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 @@ -342,23 +342,24 @@ if ( ! function_exists('safe_mailto')) $x[] = '<'; $x[] = '/'; $x[] = 'a'; $x[] = '>'; $x = array_reverse($x); - ob_start(); - - ?><script type="text/javascript"> - //<![CDATA[ - var l=new Array(); - <?php - for ($i = 0, $c = count($x); $i < $c; $i++) { ?>l[<?php echo $i; ?>]='<?php echo $x[$i]; ?>';<?php } ?> - - for (var i = l.length-1; i >= 0; i=i-1){ - if (l[i].substring(0, 1) === '|') document.write("&#"+unescape(l[i].substring(1))+";"); - else document.write(unescape(l[i]));} - //]]> - </script><?php - - $buffer = ob_get_contents(); - ob_end_clean(); - return $buffer; + + $output = "<script type=\"text/javascript\">\n" + ."\t//<![CDATA[\n" + ."\tvar l=new Array();\n"; + + for ($i = 0, $c = count($x); $i < $c; $i++) + { + $output .= "\tl[".$i."] = '".$x[$i]."';\n"; + } + + $output .= "\n\tfor (var i = l.length-1; i >= 0; i=i-1) {\n" + ."\t\tif (l[i].substring(0, 1) === '|') document.write(\"&#\"+unescape(l[i].substring(1))+\";\");\n" + ."\t\telse document.write(unescape(l[i]));\n" + ."\t}\n" + ."\t//]]>\n" + .'</script>'; + + return $output; } } |