MRBS 1.12.2 等保2.0二级整改完整提交
包含:登录失败锁定、90天密码有效期、30分钟会话超时、 强制改密、登录审计日志、屏幕水印、企业背景图、 备案信息固定底部、favicon、JS空集合保护、 会话过期体验优化(403 JSON)、display_errors 关闭、 固定 key 根治 Integrity check failed 等全部改动 注意:config.inc.php/.htaccess/.user.ini 含敏感信息, 通过 .gitignore 排除,勿推送到公开仓库。
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace MRBS;
|
||||
|
||||
|
||||
// Based on https://www.php.net/manual/en/features.file-upload.errors.php#89374
|
||||
class UploadException extends Exception
|
||||
{
|
||||
|
||||
public function __construct(int $code)
|
||||
{
|
||||
$message = $this->codeToMessage($code);
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
||||
|
||||
// Translates an error code to a message. We would not normally expect these messages
|
||||
// to be reported to the user, so they are not internationalised.
|
||||
private function codeToMessage(int $code) : string
|
||||
{
|
||||
switch ($code)
|
||||
{
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
$message = "The uploaded file exceeds the upload_max_filesize directive in php.ini";
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$message = "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form";
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$message = "The uploaded file was only partially uploaded";
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
$message = "No file was uploaded";
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
$message = "Missing a temporary folder";
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
$message = "Failed to write file to disk";
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
$message = "A PHP extension stopped the file upload";
|
||||
break;
|
||||
|
||||
default:
|
||||
$message = "Unknown upload error";
|
||||
break;
|
||||
}
|
||||
|
||||
return $message;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user