fix path = .
parent
e9c4570d55
commit
b03b51907c
|
@ -281,8 +281,8 @@ add_action('delete_attachment', 'oss_delete_remote_attachment');
|
||||||
// 当upload_path为根目录时,需要移除URL中出现的“绝对路径”
|
// 当upload_path为根目录时,需要移除URL中出现的“绝对路径”
|
||||||
function oss_modefiy_img_url($url, $post_id)
|
function oss_modefiy_img_url($url, $post_id)
|
||||||
{
|
{
|
||||||
$home_path = str_replace(array('/', '\\'), array('', ''), get_home_path());
|
// 移除 ./ 和 项目根路径
|
||||||
$url = str_replace($home_path, '', $url);
|
$url = str_replace(array('./', get_home_path()), array('', ''), $url);
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue