From 948d2e2ac98b63f86de736b693594baff59b3ecc Mon Sep 17 00:00:00 2001
From: Urban Müller
Date: Thu, 10 Aug 2017 17:17:18 +0200
Subject: bugfix: dont try to it_url::get local paths

---
 itjs.class | 4 ++--
 1 file 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();
-- 
cgit v1.2.3