-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathloader.php
61 lines (58 loc) · 1.44 KB
/
loader.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/***************************************************************************
* copyright : (C) 2008 - 2013 WeBid
* site : http://www.webidsupport.com/
***************************************************************************/
/***************************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. Although none of the code may be
* sold. If you have been sold this script, get a refund.
***************************************************************************/
ob_start('ob_gzhandler');
header("Content-type: text/javascript");
include 'inc/checks/files.php';
if (isset($_GET['js']))
{
$js = explode(';', $_GET['js']);
foreach ($js as $val)
{
$ext = substr($val, strrpos($val, '.') + 1);
if ($ext == 'php')
{
if (check_file($val))
{
include $val;
}
}
elseif ($ext == 'js' || $ext == 'css')
{
if (is_file($val))
{
echo file_get_contents($val);
echo "\n";
}
}
}
}
ob_end_flush();
function check_file($file)
{
global $file_allowed;
$tmp = $file_allowed;
$folders = explode('/', $file);
foreach ($folders as $val)
{
if (isset($tmp[$val]))
{
$tmp = $tmp[$val];
}
else
{
return false;
}
}
return true;
}
?>