From f89ffff53e212af3838fab9c627fdb59c5070d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90=E5=B0=8F=E6=96=B0?= Date: Sat, 28 Mar 2020 17:57:52 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug(=E4=BF=AE=E5=A4=8D=E5=90=8E=E7=BC=80?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GatewayWorker/Applications/githubT/start_sync.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GatewayWorker/Applications/githubT/start_sync.php b/GatewayWorker/Applications/githubT/start_sync.php index 5d60020..f342bae 100644 --- a/GatewayWorker/Applications/githubT/start_sync.php +++ b/GatewayWorker/Applications/githubT/start_sync.php @@ -43,7 +43,7 @@ $task_worker->onMessage = function ($connection, $task_data) use ($webDir,$datat } } //&& !preg_match("/^.*(?<=(\.gz|\.tar\.gz|\.bz2|\.tar|\.tar\.bz2|\.zip|\.tar\.xz|\.tar\.z|\.rpm|\.deb|\.rar))$/ix",$dataArr['url']) - if (!preg_match("/^((https|http):\/\/)?([\w\.\/\-\_^]+?)\.([tar\.gz|gz|tar\.bz2|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("/^((https|http):\/\/)?([\w\.\/\-\_^]+?)\.(tar\.gz|gz|tar\.bz2|bz2|tar|zip|tar\.xz|tar\.z|rpm|deb|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"); @@ -52,7 +52,7 @@ $task_worker->onMessage = function ($connection, $task_data) use ($webDir,$datat if (!is_dir($webDir)) { mkdir($webDir, 0777); } - if(stristr($dataArr['url'],'github') && !stristr($dataArr['url'],'.zip')) { + if(stristr($dataArr['url'],'github') && (!isset($ext) || !$ext)) { //github的检出、打包 $connection->send(json_encode([ 'status' => 0,