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,48 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace MRBS\ICalendar;
|
||||
|
||||
use DateTimeZone;
|
||||
use MRBS\DateTime;
|
||||
use function MRBS\get_vocab;
|
||||
|
||||
class RFC5545
|
||||
{
|
||||
// An array which can be used to map day of the week numbers (0..6)
|
||||
// onto days of the week as defined in RFC 5545
|
||||
public const DAYS = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'];
|
||||
|
||||
|
||||
// Convert an RFC 5545 day to an ordinal number representing the day of the week,
|
||||
// eg "MO" returns "1"
|
||||
public static function convertDayToOrd($day) : int
|
||||
{
|
||||
$tmp = array_keys(self::DAYS, $day);
|
||||
|
||||
if (count($tmp) === 0)
|
||||
{
|
||||
throw new RFC5545Exception(
|
||||
get_vocab('invalid_RFC5545_day', $day),
|
||||
RFC5545Exception::INVALID_DAY
|
||||
);
|
||||
}
|
||||
|
||||
return $tmp[0];
|
||||
}
|
||||
|
||||
|
||||
// Splits a BYDAY string into its ordinal and day parts, returned as a simple array.
|
||||
// For example "-1SU" is returned an array indexed by 'ordinal' and 'day' keys, eg
|
||||
// array('ordinal' => -1, 'day' => 'SU');
|
||||
public static function parseByday(string $byday) : array
|
||||
{
|
||||
$result = array();
|
||||
|
||||
$split_pos = mb_strlen($byday) -2;
|
||||
$result['ordinal'] = (int) mb_substr($byday, 0, $split_pos);
|
||||
$result['day'] = mb_substr($byday, $split_pos, 2);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user