diff options
-rw-r--r-- | itjs.php | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -35,6 +35,7 @@ if (it::match('W3C_CSS_Validator', $_SERVER['HTTP_USER_AGENT'])) $files = itjs::filenames($_GET['files'] ?: it::match('/itjs/([-a-z0-9_,.]*)', $_SERVER['PHP_SELF'])); $data = itjs::filecontents($files); $lastfile = end($files) ?: it::match('[^,]+$', $_GET['files']); # set correct mime type even if files not found +$nostrip = $_GET['nostrip'] && $GLOBALS['ULTRATRUSTED']; if (it::match('\.gif$', $lastfile)) { @@ -44,7 +45,7 @@ else if (it::match('\.css', $lastfile)) { header("Content-Type: text/css"); if (!it::match('^devel', $GLOBALS['ULTRASERVERTYPE'])) - $data = it::replace(array('[ \t]*([{};])[ \t]*' => '$1', '/\*.*?\*/' => ""), $data); + $data = it::replace(array('[ \t]*([{};])[ \t]*' => '$1', ($nostrip ? '_LEAVE_COMMENTS_' : '/\*.*?\*/') => ""), $data); if (it::match('W3C_CSS_Validator', $_SERVER['HTTP_USER_AGENT']) || $_GET['w3c']) $data = it::replace(array( '@-.*|@page.*' => "", @@ -85,4 +86,4 @@ else if ($files && !it::match('\.html$', $lastfile)) if (strpos($data, "<?php") !== false) it::error("sending php source?!"); -echo $_GET['nostrip'] ? $data : itjs::strip($data); +echo $nostrip ? $data : itjs::strip($data); |