This commit is contained in:
gently 2020-12-23 09:52:24 +08:00
parent 14b621428f
commit 75be6587e7

View File

@ -321,7 +321,7 @@ $whiterule = file(WHITERULE_SRC, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
$whiterule=array_fill_keys($whiterule, 0); $whiterule=array_fill_keys($whiterule, 0);
$ARR_WHITE_RULE_LIST = array_merge($whiterule, $ARR_WHITE_RULE_LIST); $ARR_WHITE_RULE_LIST = array_merge($whiterule, $ARR_WHITE_RULE_LIST);
foreach($ARR_WHITE_RULE_LIST as $row => $v){ foreach($ARR_WHITE_RULE_LIST as $row => $v){
if(empty($row) || $row{0} !== '@' || $row{1} !== '@'){ if(empty($row) || substr($row, 0, 1) !== '@' || substr($row, 1, 1) !== '@'){
continue; continue;
} }
$matches = array(); $matches = array();
@ -340,7 +340,7 @@ foreach($ARR_WHITE_RULE_LIST as $row => $v){
} }
foreach($wrote_wild as $core_str => $val){ foreach($wrote_wild as $core_str => $val){
if($core_str{0} === '/'){ if(substr($core_str, 0, 1) === '/'){
$match_rule = $core_str; $match_rule = $core_str;
}else{ }else{
$match_rule = str_replace(array('.', '*'), array('\\.', '.*'), $core_str); $match_rule = str_replace(array('.', '*'), array('\\.', '.*'), $core_str);