fix bug(修复后缀正则判断错误)
This commit is contained in:
@@ -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'])
|
//&& !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协议 或<br> (gz|tar.gz|bz2|tar|tar.bz2|zip|tar.xz|tar.z|rpm|deb|rar)格式的压缩包下载链接"]) . "\r\n");
|
$connection->send(json_encode(["status" => 1, "msg" => "请输入正确的github地址:仅支持https协议 或<br> (gz|tar.gz|bz2|tar|tar.bz2|zip|tar.xz|tar.z|rpm|deb|rar)格式的压缩包下载链接"]) . "\r\n");
|
||||||
$connection->send("true");
|
$connection->send("true");
|
||||||
@@ -52,7 +52,7 @@ $task_worker->onMessage = function ($connection, $task_data) use ($webDir,$datat
|
|||||||
if (!is_dir($webDir)) {
|
if (!is_dir($webDir)) {
|
||||||
mkdir($webDir, 0777);
|
mkdir($webDir, 0777);
|
||||||
}
|
}
|
||||||
if(stristr($dataArr['url'],'github') && !stristr($dataArr['url'],'.zip')) {
|
if(stristr($dataArr['url'],'github') && (!isset($ext) || !$ext)) {
|
||||||
//github的检出、打包
|
//github的检出、打包
|
||||||
$connection->send(json_encode([
|
$connection->send(json_encode([
|
||||||
'status' => 0,
|
'status' => 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user