This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
We want to exclude some files from viewing. |
| 5 |
*/ |
| 6 |
$excludedRegexps = array ( |
| 7 |
"^source.php$", |
| 8 |
"config.php$", |
| 9 |
"sessions.php$", // sessions data, deprecated; remove |
| 10 |
"\.\.", // anything above current directory |
| 11 |
"^\/", // path starting at root dir |
| 12 |
); |
| 13 |
|
| 14 |
$filename = $_GET ['file']; |
| 15 |
foreach ($excludedRegexps as $regexp) |
| 16 |
{ |
| 17 |
if (preg_match ("/".$regexp."/", $filename) == 1) |
| 18 |
{ |
| 19 |
print ("Get out, scum!"); |
| 20 |
exit; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
// Here we go :) |
| 25 |
highlight_file ($filename); |
| 26 |
|
| 27 |
?> |