From 3128dc23040c3409213f4ab98a5e3e2d620aebed Mon Sep 17 00:00:00 2001 From: "cn.yimian.xyz" Date: Tue, 13 Jul 2021 11:24:29 +0800 Subject: [PATCH] dn_head_bug --- functions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index de159c2..b13e04b 100755 --- a/functions.php +++ b/functions.php @@ -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){