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:
parent
2e4afde68d
commit
226f636360
@ -1547,29 +1547,23 @@ 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)
|
return urlencode($match[0]);
|
||||||
{
|
},
|
||||||
return urlencode($match[0]);
|
$Element['attributes'][$attribute]
|
||||||
},
|
);
|
||||||
$Element['attributes'][$attribute]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $Element;
|
return $Element;
|
||||||
|
Loading…
Reference in New Issue
Block a user