From 5d7939dbb7f8aeed4a41ec3fe977c6d9140bb2e7 Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Sun, 19 Sep 2021 13:57:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BF=87=E5=B7=B2=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=A4=84=E7=90=86=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后面可以考虑将分隔符和规则分开处理 --- aliyun-oss-wordpress.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliyun-oss-wordpress.php b/aliyun-oss-wordpress.php index a080090..5d1b4be 100644 --- a/aliyun-oss-wordpress.php +++ b/aliyun-oss-wordpress.php @@ -404,7 +404,7 @@ function oss_setting_content_style($content) if (!empty($images) && isset($images[1])) { $images[1] = array_unique($images[1]); foreach ($images[1] as $item) { - if(strpos($item, $option['upload_url_path']) !== false){ + if((strpos($item, $option['upload_url_path']) !== false) && (strpos($item, $option['style']) === false)){ $content = str_replace($item, $item . $option['style'], $content); } } @@ -422,7 +422,7 @@ function oss_setting_post_thumbnail_style( $html, $post_id, $post_image_id ) if (!empty($images) && isset($images[1])) { $images[1] = array_unique($images[1]); foreach ($images[1] as $item) { - if(strpos($item, $option['upload_url_path']) !== false){ + if((strpos($item, $option['upload_url_path']) !== false) && (strpos($item, $option['style']) === false)){ $html = str_replace($item, $item . $option['style'], $html); } }