Skip to content

Commit

Permalink
Merge pull request #16623 from mauriciofauth/issue-16621
Browse files Browse the repository at this point in the history
Fix link HTML messed up in Advisor
  • Loading branch information
MauricioFauth committed Feb 7, 2021
2 parents 6a4a094 + 0f463b7 commit 00be6fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -85,6 +85,7 @@ phpMyAdmin - ChangeLog
- issue #16595 Fixed editing columns having a `_` in their name in specific conditions
- issue #16608 Fix "Sort by key" restore auto saved value
- issue #16611 Fixed unable to add tables to rename aliases twice on Export
- issue #16621 Fixed link HTML messed up in Advisor

5.0.5 (not yet released)
- issue #14494 Fix uncaught TypeError when editing partitioning
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Advisor.php
Expand Up @@ -345,7 +345,7 @@ function (array $matches) {

// Replaces external Links with Core::linkURL() generated links
$rule['recommendation'] = preg_replace_callback(
'#href=("|\')(https?://[^\1]+)\1#i',
'#href=("|\')(https?://[^"\']+)\1#i',
function (array $matches) {
return $this->replaceLinkURL($matches);
},
Expand Down
9 changes: 6 additions & 3 deletions test/classes/AdvisorTest.php
Expand Up @@ -259,15 +259,18 @@ public function rulesProvider(): array
'justification_formula' => 'ADVISOR_formatByteDown(1000000, 2, 2)',
'name' => 'Distribution',
'issue' => 'official MySQL binaries.',
'recommendation' => 'See <a href="https://example.com/">web</a>',
'recommendation' => 'See <a href="https://example.com/">web</a> and'
. ' <a href="https://example.com/">web2</a>',
],
[
'justification' => 'Memory: 0.95 MiB',
'justification_formula' => 'ADVISOR_formatByteDown(1000000, 2, 2)',
'name' => 'Distribution',
'issue' => 'official MySQL binaries.',
'recommendation' => 'See <a href="./url.php?url=https%3A%2F%2F' .
'example.com%2F" target="_blank" rel="noopener noreferrer">web</a>',
'recommendation' => 'See <a href="./url.php?url=https%3A%2F%2F'
. 'example.com%2F" target="_blank" rel="noopener noreferrer">web</a>'
. ' and <a href="./url.php?url=https%3A%2F%2Fexample.com%2F" target="_blank"'
. ' rel="noopener noreferrer">web2</a>',
'id' => 'Distribution',
],
null,
Expand Down

0 comments on commit 00be6fd

Please sign in to comment.