Merge pull request #429 from conory/develop

아이프레임, 오브젝트 태그 src에서 http 가 없으면 무조건 필터 되는 문제 수정
This commit is contained in:
CONORY 2016-04-04 23:43:06 +09:00
commit cfba57979f

View file

@ -79,7 +79,7 @@ class MediaFilter
*/
public static function formatPrefix($prefix)
{
$prefix = preg_match('@^https?://(.*)$@i', $prefix, $matches) ? $matches[1] : $prefix;
$prefix = preg_match('@^(https?:)?//(.*)$@i', $prefix, $matches) ? $matches[2] : $prefix;
if (strpos($prefix, '/') === false)
{
$prefix .= '/';
@ -117,7 +117,7 @@ class MediaFilter
{
$result[] = str_replace('\*\.', '[a-z0-9-]+\.', preg_quote($domain, '%'));
}
return '%^https?://(' . implode('|', $result) . ')%';
return '%^(https?:)?//(' . implode('|', $result) . ')%';
}
/**
@ -150,7 +150,7 @@ class MediaFilter
{
$result[] = str_replace('\*\.', '[a-z0-9-]+\.', preg_quote($domain, '%'));
}
return '%^https?://(' . implode('|', $result) . ')%';
return '%^(https?:)?//(' . implode('|', $result) . ')%';
}
/**