summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2017-08-10 17:17:18 +0200
committerUrban Müller2017-08-10 17:17:18 +0200
commit948d2e2ac98b63f86de736b693594baff59b3ecc (patch)
tree9848fded662a8da85dc203c18d4aba3b33585df2
parentd88f1056eb57779852de8654f292edf50ac44aaf (diff)
downloaditools-948d2e2ac98b63f86de736b693594baff59b3ecc.tar.gz
itools-948d2e2ac98b63f86de736b693594baff59b3ecc.tar.bz2
itools-948d2e2ac98b63f86de736b693594baff59b3ecc.zip
bugfix: dont try to it_url::get local paths
-rw-r--r--itjs.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/itjs.class b/itjs.class
index 614926d..c81880a 100644
--- a/itjs.class
+++ b/itjs.class
@@ -147,7 +147,7 @@ static function filenames($filelist)
}
/**
- * Return (php-interpreted by default) files that will be sent to client. Files must exist.
+ * Return content of (php-interpreted by default) TRUSTED filenames that will be sent to client. Files must exist.
*/
static function filecontents($filenames)
{
@@ -160,7 +160,7 @@ static function filecontents($filenames)
list($filename, $paramstr) = explode("?", $filename);
if ($paramstr)
parse_str($paramstr, $_GET);
- $result .= it::replace(array('^1$' => ""), it::match('\.(js|css|htc)$', $filename) ? include_once($filename) : it_url::get($filename), array('utf8' => false));
+ $result .= it::replace(array('^1$' => ""), it::match('\.(js|css|htc)$', $filename) ? include_once($filename) : (file_exists($filename) ? file_get_contents($filename) : it_url::get($filename)), array('utf8' => false));
$_GET = $origget;
}
$result .= ob_get_clean();