diff options
author | Urban Müller | 2016-03-29 17:58:51 +0200 |
---|---|---|
committer | Urban Müller | 2016-03-29 17:58:51 +0200 |
commit | a95f344fd13383121fdcb654ebb53c102cf4bf3a (patch) | |
tree | a6315bd6c77ae3ea32020df461b539ac50460298 | |
parent | b60d311bafc1ef55304264cc2c1c6310d3bce29e (diff) | |
download | itools-a95f344fd13383121fdcb654ebb53c102cf4bf3a.tar.gz itools-a95f344fd13383121fdcb654ebb53c102cf4bf3a.tar.bz2 itools-a95f344fd13383121fdcb654ebb53c102cf4bf3a.zip |
variable rename
-rw-r--r-- | itjs.php | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -31,13 +31,13 @@ itjs::far_future_headers(); # may exit $files = itjs::filenames($_GET['files'] ?: it::match('/itjs/([-a-z0-9_,.]*)', $_SERVER['PHP_SELF'])); $data = itjs::filecontents($files); -$file = end($files); +$lastfile = end($files); -if (it::match('\.gif$', $file)) +if (it::match('\.gif$', $lastfile)) { header("Content-Type: image/gif"); } -else if (it::match('\.css', $file)) +else if (it::match('\.css', $lastfile)) { header("Content-Type: text/css"); $data .= "\n#it_boot_dom { display:none }\n"; # Append magic style for it_boot @@ -67,14 +67,14 @@ else if (it::match('\.css', $file)) $data ); } -else if (it::match('\.htc$', $file)) +else if (it::match('\.htc$', $lastfile)) { header("Content-Type: text/x-component"); } -else if (!it::match('\.html$', $file)) +else if (!it::match('\.html$', $lastfile)) { $data = "window.trace+='i';\n$data\nwindow.trace+='I';\n"; - $data .= "\nwindow.it_gotjs = (window.it_gotjs ? window.it_gotjs : '') + '." . it::match('\w+', basename($file)) . "';\n"; + $data .= "\nwindow.it_gotjs = (window.it_gotjs ? window.it_gotjs : '') + '." . it::match('\w+', basename($lastfile)) . "';\n"; $charset = ini_get('default_charset') ?: 'iso-8859-1'; header("Content-Type: application/x-javascript; charset=$charset"); } |