-
Notifications
You must be signed in to change notification settings - Fork 57
/
config.php
45 lines (36 loc) · 1.49 KB
/
config.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
<?php header("Content-Type:text/html; charset=utf-8"); date_default_timezone_set("Asia/Taipei");
require_once dirname(__FILE__) .'/libs/BaiduPCS.class.php';
$appName = 'zqqian123';//应用目录名
$root_dir = '/apps' . '/' . $appName . '/';//应用根目录,不要修改
$sitehost = $_SERVER['HTTP_HOST'];
/*==== 使用 prefetch.php qiuniu-del.php 须配置七牛 AccessKey SecretKey bucket ====*/
$accessKey = "";
$secretKey = "";
$bucket = "";
/*==== 七牛 ====*/
$qiniu_host = '';//七牛镜像,你的七牛域名,勿加http://
function sizecount ($filesize)
{
if ($filesize >= 1073741824) $filesize = round($filesize / 1073741824 * 100) / 100 . ' GB';
elseif ($filesize >= 1048576) $filesize = round($filesize / 1048576 * 100) / 100 . ' MB';
elseif ($filesize >= 1024) $filesize = round($filesize / 1024 * 100) / 100 . ' KB';
else $filesize = $filesize . ' Bytes';
return $filesize;
}
/*==== XSS简单过滤 =====*/
if($_SERVER['REQUEST_URI']) {
$temp = urldecode($_SERVER['REQUEST_URI']);
if(strpos($temp, '<') !== false || strpos($temp, '>') !== false || strpos($temp, '(') !== false || strpos($temp, '"') !== false) {
exit('Request Bad url');
}
}
function escape($value)
{
$value = is_array($value) ? array_map('escape',$value):htmlspecialchars(trim($value));
return get_magic_quotes_gpc()?$value:addslashes($value);
}
$_GET = array_map('escape', $_GET);
$_POST = array_map('escape', $_POST);
$_COOKIE = array_map('escape', $_COOKIE);
$_REQUEST = array_map('escape', $_REQUEST);
?>