N°2235.2 Fix emptied URLs on object modification when URL starts with a placeholder

This commit is contained in:
Molkobain
2019-06-11 16:13:53 +02:00
parent a0cd281c42
commit 9a5a5f858f

View File

@@ -249,7 +249,8 @@ class HTMLDOMSanitizer extends HTMLSanitizer
// Notification placeholders
// eg. $this->caller_id$, $this->hyperlink()$, $this->hyperlink(portal)$, $APP_URL$, $MODULES_URL$, ...
$sPlaceholderPattern = '\$[\w-]*(->[\w]*(\([\w-]*?\))?)?\$';
// Note: Authorize both $xxx$ and %24xxx%24 as the latter one is encoded when used in HTML attributes (eg. a[href])
$sPlaceholderPattern = '(\$|%24)[\w-]*(->[\w]*(\([\w-]*?\))?)?(\$|%24)';
$sPattern = $sUrlPattern . '|' . $sMailtoPattern . '|' . $sPlaceholderPattern;
$sPattern = '/'.str_replace('/', '\/', $sPattern).'/i';