mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-08 00:54:26 +02:00
Add rel="noopener noreferrer" to all target="_blank" links
See https://mathiasbynens.github.io/rel-noopener/
This commit is contained in:
parent
6a3d40ab46
commit
b100b9600e
22 changed files with 54 additions and 54 deletions
|
@ -164,7 +164,7 @@ class BBCodeTest extends MockedTest
|
|||
public function testAutoLinking($data, $assertHTML)
|
||||
{
|
||||
$output = BBCode::convert($data);
|
||||
$assert = '<a href="' . $data . '" target="_blank">' . $data . '</a>';
|
||||
$assert = '<a href="' . $data . '" target="_blank" rel="noopener noreferrer">' . $data . '</a>';
|
||||
if ($assertHTML) {
|
||||
$this->assertEquals($assert, $output);
|
||||
} else {
|
||||
|
@ -176,21 +176,21 @@ class BBCodeTest extends MockedTest
|
|||
{
|
||||
return [
|
||||
'bug-7271-condensed-space' => [
|
||||
'expectedHtml' => '<ul class="listdecimal" style="list-style-type: decimal;"><li> <a href="http://example.com/" target="_blank">http://example.com/</a></li></ul>',
|
||||
'expectedHtml' => '<ul class="listdecimal" style="list-style-type: decimal;"><li> <a href="http://example.com/" target="_blank" rel="noopener noreferrer">http://example.com/</a></li></ul>',
|
||||
'text' => '[ol][*] http://example.com/[/ol]',
|
||||
],
|
||||
'bug-7271-condensed-nospace' => [
|
||||
'expectedHtml' => '<ul class="listdecimal" style="list-style-type: decimal;"><li><a href="http://example.com/" target="_blank">http://example.com/</a></li></ul>',
|
||||
'expectedHtml' => '<ul class="listdecimal" style="list-style-type: decimal;"><li><a href="http://example.com/" target="_blank" rel="noopener noreferrer">http://example.com/</a></li></ul>',
|
||||
'text' => '[ol][*]http://example.com/[/ol]',
|
||||
],
|
||||
'bug-7271-indented-space' => [
|
||||
'expectedHtml' => '<ul class="listbullet" style="list-style-type: circle;"><li> <a href="http://example.com/" target="_blank">http://example.com/</a></li></ul>',
|
||||
'expectedHtml' => '<ul class="listbullet" style="list-style-type: circle;"><li> <a href="http://example.com/" target="_blank" rel="noopener noreferrer">http://example.com/</a></li></ul>',
|
||||
'text' => '[ul]
|
||||
[*] http://example.com/
|
||||
[/ul]',
|
||||
],
|
||||
'bug-7271-indented-nospace' => [
|
||||
'expectedHtml' => '<ul class="listbullet" style="list-style-type: circle;"><li><a href="http://example.com/" target="_blank">http://example.com/</a></li></ul>',
|
||||
'expectedHtml' => '<ul class="listbullet" style="list-style-type: circle;"><li><a href="http://example.com/" target="_blank" rel="noopener noreferrer">http://example.com/</a></li></ul>',
|
||||
'text' => '[ul]
|
||||
[*]http://example.com/
|
||||
[/ul]',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue