diff options
-rw-r--r-- | itjs.class | 11 | ||||
-rw-r--r-- | itjs.php | 2 |
2 files changed, 10 insertions, 3 deletions
@@ -134,9 +134,9 @@ static function filenames($filelist) "PIE.htc" => "$libsearch/doc/PIE.htc", ); - foreach (array_filter(explode(",", it::replace(array('\?.*' => ""), basename($filelist)))) as $file) + foreach (array_filter(explode(",", basename($filelist))) as $file) { - $filenames = $special[$file] ? $special[$file] : "$path/$file"; + $filenames = $special[$file] ?: (file_exists("$path/" . it::replace(array('\?.*' => ""), $file)) ? "$path/$file" : "$libsearch/itjs/$file"); foreach (explode(",", $filenames) as $filename) if (!$seen[$filename]++) @@ -155,7 +155,14 @@ static function filecontents($filenames, $execphp = true) { 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))) + { + $origget = $_GET; + list($filename, $paramstr) = explode("?", $filename); + if ($paramstr && $execphp) + parse_str($paramstr, $_GET); $result .= it::replace(array('^1$' => ""), $execphp ? @include($filename) : @file_get_contents($filename), array('utf8' => false)); + $_GET = $origget; + } $result .= ob_get_clean(); } @@ -31,7 +31,7 @@ if (false && $crc != "-" && !$_SERVER['HTTP_CACHE_CONTROL'] && $_SERVER['HTTP_IF exit; } -$files = itjs::filenames(it::match('/itjs/([a-z0-9_,.-]*)', $_SERVER['PHP_SELF'])); +$files = itjs::filenames($_GET['files'] ?: it::match('/itjs/([-a-z0-9_,.]*)', $_SERVER['PHP_SELF'])); $data = itjs::filecontents($files); $file = end($files); |