mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-12 05:22:35 +09:00
Fix #320 again: Always use local path if file exists
This commit is contained in:
parent
57c225ff75
commit
1d763db5fd
1 changed files with 6 additions and 2 deletions
|
|
@ -1051,9 +1051,13 @@ class memberModel extends member
|
||||||
$info->title = $group_info->title;
|
$info->title = $group_info->title;
|
||||||
$info->description = $group_info->description;
|
$info->description = $group_info->description;
|
||||||
$info->src = $group_info->image_mark;
|
$info->src = $group_info->image_mark;
|
||||||
if(parse_url($info->src, PHP_URL_HOST) === parse_url(Context::getDefaultUrl(), PHP_URL_HOST))
|
if(preg_match('@^https?://@', $info->src))
|
||||||
{
|
{
|
||||||
$info->src = preg_replace('@^https?://[^/]+@i', '', $info->src);
|
$localpath = str_replace('/./', '/', parse_url($info->src, PHP_URL_PATH));
|
||||||
|
if(file_exists($_SERVER['DOCUMENT_ROOT'] . $localpath))
|
||||||
|
{
|
||||||
|
$info->src = $localpath . '?' . date('YmdHis', filemtime($_SERVER['DOCUMENT_ROOT'] . $localpath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$GLOBALS['__member_info__']['group_image_mark'][$member_srl] = $info;
|
$GLOBALS['__member_info__']['group_image_mark'][$member_srl] = $info;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue