summaryrefslogtreecommitdiff
path: root/itjs.php
diff options
context:
space:
mode:
authorChristian Helbling2012-04-04 09:25:06 +0000
committerChristian Helbling2012-04-04 09:25:06 +0000
commita0231e4df6f8bfa82451c05998bb349ece764610 (patch)
tree6c1d9e76e8a6388fdf7f1d2435f0da082bd7de62 /itjs.php
parent1336ce6ac3baacd1cecbf776cfafa81f8d025272 (diff)
parent14f1c25b43628013507da706544d5c55cb1bc461 (diff)
downloaditools-a0231e4df6f8bfa82451c05998bb349ece764610.tar.gz
itools-a0231e4df6f8bfa82451c05998bb349ece764610.tar.bz2
itools-a0231e4df6f8bfa82451c05998bb349ece764610.zip
Merged devel-utf8 back into live
Diffstat (limited to 'itjs.php')
-rw-r--r--itjs.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/itjs.php b/itjs.php
index 03073e9..f819cab 100644
--- a/itjs.php
+++ b/itjs.php
@@ -33,7 +33,7 @@ foreach ($files as $file)
{
ob_start(); # Needs to capture inside loop to guarantee file order
if (!(it::match('W3C_CSS_Validator', $_SERVER['HTTP_USER_AGENT']) && it::match('jquery-ui\.css', $file)))
- $data .= it::replace(array('^1$' => ""), @include($file));
+ $data .= it::replace(array('^1$' => ""), @include($file), array('utf8' => false));
$data .= ob_get_clean();
}
@@ -50,9 +50,8 @@ else if (it::match('\.css', $_SERVER['PHP_SELF']))
$data .= "\n#it_boot_dom { display:none }\n"; # Append magic style for it_boot
if (!it::match('^devel', $GLOBALS['ULTRASERVERTYPE']))
$data = it::replace(array('[ \t]*([{};])[ \t]*' => '$1', '/\*.*?\*/' => ""), $data);
- if (it::match('W3C_CSS_Validator', $_SERVER['HTTP_USER_AGENT']) || EDC('w3c')) {
+ if (it::match('W3C_CSS_Validator', $_SERVER['HTTP_USER_AGENT']) || EDC('w3c'))
$data = it::replace(array('@-.*' => "", 'background[^;}]*(gradient|rgba)[^;}]*;?' => "", '(filter:\s*(progid|none)|text-overflow:|zoom:|-webkit-|display:-moz-|-moz-|-o-|cursor:|border-radius:|behavior:|\w+:expression)[^;}]*;?' => "", 'html\.ie6.*' => "", '([^/])\*(\w)' => '$1$2'), $data);
- }
}
else if (it::match('\.htc$', $file))
{
@@ -64,7 +63,8 @@ else if (!it::match('\.html$', $file))
if ($_REQUEST['boot'] && !$_REQUEST['retry'])
ob_start('ob_gzhandler');
- header("Content-Type: application/x-javascript; charset=iso-8859-1");
+ $charset = ini_get('default_charset') ?: 'iso-8859-1';
+ header("Content-Type: application/x-javascript; charset=$charset");
}
@header("Etag: $checksum");
@@ -80,7 +80,7 @@ if ($checksum != $_SERVER['HTTP_IF_NONE_MATCH'])
{
$data .= "window.it_boot_init();\n";
if (!$_REQUEST['script'])
- $data = sprintf("/*sln:%d*/\n%s/*eln:%d*/", strlen($data), strtr($data, array('%' => "%25", '.' => "%2e", 'e' => "%65", 'i' => "%69")), strlen($data)); # Protect from Firewalls/Proxies altering Javascript source code
+ $data = sprintf("/*sln:%d*/\n%s/*eln:%d*/", grapheme_strlen($data), strtr($data, array('%' => "%25", '.' => "%2e", 'e' => "%65", 'i' => "%69")), grapheme_strlen($data)); # Protect from Firewalls/Proxies altering Javascript source code
}
echo it_untaint($data);