summaryrefslogtreecommitdiff
path: root/itjs.class
diff options
context:
space:
mode:
authorUrban Müller2013-10-18 12:13:21 +0000
committerUrban Müller2013-10-18 12:13:21 +0000
commit6583f6132f88a32ba4aa8a40533f664201e175a4 (patch)
treefbc16ca12457aea02deb1ca89ae0a126217c7d20 /itjs.class
parent806f87267ca3cccde53749cfba5802b16aad1c9b (diff)
downloaditools-6583f6132f88a32ba4aa8a40533f664201e175a4.tar.gz
itools-6583f6132f88a32ba4aa8a40533f664201e175a4.tar.bz2
itools-6583f6132f88a32ba4aa8a40533f664201e175a4.zip
dont execute php (which sometimes sets content-type) when generating checksum
Diffstat (limited to 'itjs.class')
-rw-r--r--itjs.class6
1 files changed, 3 insertions, 3 deletions
diff --git a/itjs.class b/itjs.class
index f91c388..c54418d 100644
--- a/itjs.class
+++ b/itjs.class
@@ -151,13 +151,13 @@ static function filenames($filelist)
/**
* Return (interpreted) files that will be sent to client
*/
-static function filecontents($filenames)
+static function filecontents($filenames, $execphp = true)
{
foreach ($filenames as $filename)
{
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', $filename)))
- $result .= it::replace(array('^1$' => ""), @include($filename), array('utf8' => false));
+ $result .= it::replace(array('^1$' => ""), $execphp ? @include($filename) : file_get_contents($filename), array('utf8' => false));
$result .= ob_get_clean();
}
@@ -192,7 +192,7 @@ static function checksum($fnlist)
{
$key = "itjs_" . md5(join("", it::map('"$v" . filemtime("$v")', is_array($fnlist) ? $fnlist : itjs::filenames($fnlist))));
- return it_cache::get($key) ?: it_cache::put($key, substr(md5(self::filecontents(is_array($fnlist) ? $fnlist : itjs::filenames($fnlist))), 0, 8));
+ return it_cache::get($key) ?: it_cache::put($key, substr(md5(self::filecontents(is_array($fnlist) ? $fnlist : itjs::filenames($fnlist), false)), 0, 8));
}
}