Fix #1458 unnecessary slash in script concatenation (regression from e9bec85)

This commit is contained in:
Kijin Sung 2020-11-11 15:11:53 +09:00
parent d9397bf6fe
commit 2c1d380a0a

View file

@ -223,7 +223,10 @@ class HTMLDisplayHandler
// handles a relative path generated by using the rewrite module
if(Context::isAllowRewrite())
{
$pattern = '/(action|src|href)=(["\'])(?:\.\/([^"\']*))?(["\'])/s';
$pattern = '/(action)=(["\'])(["\'])/s';
$output = preg_replace($pattern, '$1=$2' . \RX_BASEURL . '$3', $output);
$pattern = '/(action|src|href)=(["\'])\.\/([^"\']*)(["\'])/s';
$output = preg_replace($pattern, '$1=$2' . \RX_BASEURL . '$3$4', $output);
$pattern = '/src=(["\'])((?:files\/(?:attach|cache|faceOff|member_extra_info|thumbnails)|addons|common|(?:m\.)?layouts|modules|widgets|widgetstyle)\/[^"\']+)(["\'])/s';