-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,671 changed files
with
45,493 additions
and
34,816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,3 @@ | |
/template/uni-app/node_modules/ | ||
/template/uni-app/unpackage/ | ||
/template/uni-app/.hbuilderx/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
version=CRMEB-KY v5.3.0 | ||
version_code=530 | ||
version=CRMEB-KY v5.4.0 | ||
version_code=540 | ||
platform=github | ||
app_id=ze7x9rxsv09l6pvsyo | ||
app_key=fuF7U9zaybLa5gageVQzxtxQMFnvU2OI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ class Request extends \think\Request | |
* @var array | ||
*/ | ||
protected $except = ['menu_path', 'api_url', 'unique_auth', | ||
'description', 'custom_form', 'content', 'tableField', 'url']; | ||
'description', 'custom_form', 'content', 'tableField', 'url', 'customCode']; | ||
|
||
/** | ||
* 获取请求的数据 | ||
|
@@ -49,7 +49,7 @@ public function more(array $params, bool $suffix = false, bool $filter = true): | |
$i = 0; | ||
foreach ($params as $param) { | ||
if (!is_array($param)) { | ||
$p[$suffix == true ? $i++ : $param] = $this->filterWord(is_string($this->param($param)) ? trim($this->param($param)) : $this->param($param), $filter && !in_array($param, $this->except)); | ||
$p[$suffix == true ? $i++ : $param] = $this->param($param); | ||
} else { | ||
if (!isset($param[1])) $param[1] = null; | ||
if (!isset($param[2])) $param[2] = ''; | ||
|
@@ -61,70 +61,41 @@ public function more(array $params, bool $suffix = false, bool $filter = true): | |
$keyName = $param[0]; | ||
} | ||
|
||
$p[$suffix == true ? $i++ : ($param[3] ?? $keyName)] = $this->filterWord( | ||
is_string($this->param($name, $param[1], $param[2])) ? | ||
trim($this->param($name, $param[1], $param[2])) : | ||
$this->param($name, $param[1], $param[2]), | ||
$filter && !in_array($keyName, $this->except)); | ||
$p[$suffix == true ? $i++ : ($param[3] ?? $keyName)] = $this->param($name, $param[1], $param[2]); | ||
} | ||
} | ||
|
||
if ($filter && $p) { | ||
$p = $this->filterArrayValues($p); | ||
} | ||
|
||
return $p; | ||
} | ||
|
||
/** | ||
* 过滤接受的参数 | ||
* 过滤接数组中的字符串 | ||
* @param $str | ||
* @param bool $filter | ||
* @return array|mixed|string|string[] | ||
*/ | ||
public function filterWord($str, bool $filter = true) | ||
public function filterArrayValues($array) | ||
{ | ||
if (!$str || !$filter) return $str; | ||
// 把数据过滤 | ||
$farr = [ | ||
"/<(\\/?)(script|i?frame|style|html|body|title|link|meta|object|\\?|\\%)([^>]*?)>/isU", | ||
"/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU", | ||
'/phar/is', | ||
"/select|join|where|drop|like|modify|rename|insert|update|table|database|alter|truncate|\'|\/\*|\.\.\/|\.\/|union|into|load_file|outfile/is" | ||
]; | ||
if (is_array($str)) { | ||
foreach ($str as &$v) { | ||
if (is_array($v)) { | ||
foreach ($v as &$vv) { | ||
if (!is_array($vv)) { | ||
$vv = $this->replaceWord($farr, $vv); | ||
} | ||
} | ||
$result = []; | ||
foreach ($array as $key => $value) { | ||
if (is_array($value)) { | ||
// 如果值是数组,递归调用 filterArrayValues | ||
$result[$key] = $this->filterArrayValues($value); | ||
} else { | ||
if (in_array($key, $this->except) || is_int($value) || is_null($value)) { | ||
$result[$key] = $value; | ||
} else { | ||
$v = $this->replaceWord($farr, $v); | ||
// 如果值是字符串,过滤特殊字符 | ||
$result[$key] = filter_str($value); | ||
} | ||
} | ||
} else { | ||
$str = $this->replaceWord($farr, $str); | ||
} | ||
return $str; | ||
} | ||
|
||
/** | ||
* 替换 | ||
* @param $farr | ||
* @param $str | ||
* @return array|string|string[]|null | ||
* @author: 吴汐 | ||
* @email: [email protected] | ||
* @date: 2023/9/19 | ||
*/ | ||
public function replaceWord($farr, $str) | ||
{ | ||
if (filter_var($str, FILTER_VALIDATE_URL)) { | ||
$url = parse_url($str); | ||
if (!isset($url['scheme'])) return $str; | ||
$host = $url['scheme'] . ':https://' . $url['host']; | ||
$str = $host . preg_replace($farr, '', str_replace($host, '', $str)); | ||
} else { | ||
$str = preg_replace($farr, '', $str); | ||
} | ||
} | ||
return $str; | ||
return $result; | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.