From 3f210dfd23303ca830dabd1b5ea093c587192471 Mon Sep 17 00:00:00 2001 From: lc6464 <64722907+lc6464@users.noreply.github.com> Date: Sat, 3 Apr 2021 21:06:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20curl=20=E5=8F=8A=20mysqli?= =?UTF-8?q?=20=E6=89=A9=E5=B1=95=E6=9C=AA=E5=AE=89=E8=A3=85=E6=88=96?= =?UTF-8?q?=E6=9C=AA=E5=90=AF=E7=94=A8=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.php | 4 +++- index.php | 2 +- install/config_raw | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/api.php b/api.php index b8d3a114..a500965e 100644 --- a/api.php +++ b/api.php @@ -299,7 +299,9 @@ $DBPassword = (!empty($_POST["DBPassword"])) ? $_POST["DBPassword"] : ""; $dbname = (!empty($_POST["dbname"])) ? $_POST["dbname"] : ""; $dbtable = (!empty($_POST["dbtable"])) ? $_POST["dbtable"] : ""; - + if (!function_exists('mysqli_connect')) { + EchoInfo(-2, array("msg" => "
您未安装或未启用 mysqli 扩展,
不能使用数据库功能。
请自行关闭数据库功能。")); + } $conn = mysqli_connect($servername, $username, $DBPassword); $GLOBALS['conn'] = $conn; // Check connection diff --git a/index.php b/index.php index 0ffe1bf9..49fa972e 100644 --- a/index.php +++ b/index.php @@ -197,7 +197,7 @@ function confirmdl(fs_id, timestamp, sign, randsk, share_id, uk, bdstoken, files } echo $filecontent . ""; - // exit; + // exit; } else { // 解析异常 $ErrorCode = $Filejson["errtype"]; diff --git a/install/config_raw b/install/config_raw index d7ea89dd..78cd38e1 100644 --- a/install/config_raw +++ b/install/config_raw @@ -13,6 +13,12 @@ if (!defined('init')) { http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./'); die("HTTP 403 禁止访问!\r\n此文件是 PanDownload 网页复刻版 PHP 语言版项目版本 " . programVersion . " 的配置文件!\r\n禁止直接访问!"); } +if (!function_exists('curl_init')) { + http_response_code(503); + header('Content-Type: text/plain; charset=utf-8'); + die("HTTP 503 服务不可用!\r\n您未安装或未启用 Curl 扩展,此程序无法运行!"); +} + const Sitename = ''; const BDUSS = '';