1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

remove $safe flag

This commit is contained in:
Aidan Woods 2017-05-07 13:45:59 +01:00
parent 2e4afde68d
commit 226f636360
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -1547,20 +1547,14 @@ class Parsedown
{ {
if ($this->safeLinksEnabled) if ($this->safeLinksEnabled)
{ {
$safe = false;
foreach ($this->safeLinksWhitelist as $scheme) foreach ($this->safeLinksWhitelist as $scheme)
{ {
if (self::striAtStart($Element['attributes'][$attribute], $scheme)) if (self::striAtStart($Element['attributes'][$attribute], $scheme))
{ {
$safe = true; return $Element;
break;
} }
} }
if ( ! $safe)
{
$Element['attributes'][$attribute] = preg_replace_callback( $Element['attributes'][$attribute] = preg_replace_callback(
'/[^\/#?&=%]++/', '/[^\/#?&=%]++/',
function (array $match) function (array $match)
@ -1569,7 +1563,7 @@ class Parsedown
}, },
$Element['attributes'][$attribute] $Element['attributes'][$attribute]
); );
}
} }
return $Element; return $Element;