diff options
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/file_helper.php | 1 | ||||
-rw-r--r-- | system/helpers/url_helper.php | 35 |
2 files changed, 18 insertions, 18 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 575b87479..b8b70534f 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -267,7 +267,6 @@ if ( ! function_exists('get_file_info')) */ function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) { - if ( ! file_exists($file)) { return FALSE; diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index a9790e5c4..5f11a42ca 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -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; } } |