From a3f2a405f05051cc4ed81e3e08ee85833dcbb771 Mon Sep 17 00:00:00 2001 From: jingxin he Date: Wed, 27 May 2020 22:10:54 +0800 Subject: [PATCH] Update start_sync.php fix bug --- GatewayWorker/Applications/githubT/start_sync.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/GatewayWorker/Applications/githubT/start_sync.php b/GatewayWorker/Applications/githubT/start_sync.php index fda500a..f46a3a1 100644 --- a/GatewayWorker/Applications/githubT/start_sync.php +++ b/GatewayWorker/Applications/githubT/start_sync.php @@ -42,7 +42,13 @@ $task_worker->onMessage = function ($connection, $task_data) use ($webDir,$datat break; } } - if (!preg_match("/^((https|http):\/\/)?([\w\.\/\-\_^]+?)\.(tar\.gz|gz|tar\.bz2|exe|apk|bz2|tar|zip|tar\.xz|tar\.z|rpm|deb|rar)$/iu",$dataArr['url'],$ext) && !preg_match("/^https:\/\/github.com\/([\w\/\-\.\_]+)$/iu", $dataArr['url']) + if (preg_match("/%|\"|\.\.|\\\|\?|&|reboot|rm |mv |shutdown|<|>|sh |;|'/",$dataArr['url']) + || + ( + !preg_match("/^((https|http):\/\/)?([\w\.\s\S\/\-\_^]+?)\.(tar\.gz|gz|tgz|tar\.bz2|bz2|msi|tar|zip|tar\.xz|tar\.z|rpm|deb|exe|apk|dmg|7z|rar)$/iu",$dataArr['url'],$ext) + && !preg_match("/^https:\/\/github.com\/([\w\/\-\.\_]+)$/iu", $dataArr['url'] + ) + ) ) { $connection->send(json_encode(["status" => 1, "msg" => "请输入正确的github地址:仅支持https协议 或
(gz|tar.gz|bz2|tar|tar.bz2|zip|tar.xz|tar.z|rpm|deb|rar)格式的压缩包下载链接"]) . "\r\n"); $connection->send("true");