完善替换相对路径

master
yin5th 2023-12-07 10:03:30 +08:00
parent 0f7d5fe9db
commit b0602c1e10
1 changed files with 1 additions and 1 deletions
server/app/api/logic

View File

@ -37,7 +37,7 @@ class GoodsLogic extends Logic
$domain = request()->domain(); $domain = request()->domain();
} }
$pregRule = "/<[img|IMG].*?src=[\'|\"][\/uploads]{1}(.*?(?:[\.jpg|\.jpeg|\.png|\.gif|\.bmp]))[\'|\"].*?[\/]?>/"; $pregRule = "/<[img|IMG].*?src=[\'|\"][\/uploads]{1}(.*?(?:[\.jpg|\.jpeg|\.png|\.gif|\.bmp]))[\'|\"].*?[\/]?>/";
return preg_replace($pregRule, '< img src="' . $domain . '/${1}" style="max-width:100%">', (string)$content ); return preg_replace($pregRule, '<img src="' . $domain . '/${1}" style="max-width:100%">', (string)$content );
} }
/** /**
* 商品详情 * 商品详情