summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--itjs.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/itjs.php b/itjs.php
index db9c642..68f1213 100644
--- a/itjs.php
+++ b/itjs.php
@@ -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);