mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
add single safeMode option that encompasses protection from link destination xss and plain markup based xss into a single on/off switch
This commit is contained in:
@@ -46,7 +46,7 @@ class ParsedownTest extends PHPUnit_Framework_TestCase
|
||||
$expectedMarkup = str_replace("\r\n", "\n", $expectedMarkup);
|
||||
$expectedMarkup = str_replace("\r", "\n", $expectedMarkup);
|
||||
|
||||
$this->Parsedown->setMarkupEscaped($test === 'xss_text_encoding');
|
||||
$this->Parsedown->setSafeMode(substr($test, 0, 3) === 'xss');
|
||||
|
||||
$actualMarkup = $this->Parsedown->text($markdown);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<p><a href="http://example.com">link</a></p>
|
||||
<p><a href="/url-%28parentheses%29">link</a> with parentheses in URL </p>
|
||||
<p><a href="/url-(parentheses)">link</a> with parentheses in URL </p>
|
||||
<p>(<a href="/index.php">link</a>) in parentheses</p>
|
||||
<p><a href="http://example.com"><code>link</code></a></p>
|
||||
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /></a></p>
|
||||
|
||||
Reference in New Issue
Block a user