Skip to content

Commit

Permalink
dn_head_bug
Browse files Browse the repository at this point in the history
  • Loading branch information
IoTcat committed Jul 13, 2021
1 parent 58419f0 commit 3128dc2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions functions.php
Expand Up @@ -310,8 +310,11 @@ function getImgOneindex($path){
}

function getImgCDN($path){
preg_match_all('/img_(\S*?)_(\d{2,4})x(\d{2,4})_(\S*?)_(\S*?)_(\S*?).(jpe?g|png|gif|svg)\b/', $path, $arr);
return str_replace('moe','https://cdn.jsdelivr.net/npm/ushio-api-img-moe@5.0.'.intval($arr[1][0]/10).'',$path);
if(stripos($path, 'moe') !== false){
preg_match_all('/img_(\S*?)_(\d{2,4})x(\d{2,4})_(\S*?)_(\S*?)_(\S*?).(jpe?g|png|gif|svg)\b/', $path, $arr);
return str_replace('moe','https://cdn.jsdelivr.net/npm/ushio-api-img-moe@5.0.'.intval($arr[1][0]/10).'',$path);
}
return getImg($path);
}

function getImgCDNwallpaper($path){
Expand Down

0 comments on commit 3128dc2

Please sign in to comment.