Merge pull request #16623 from mauriciofauth/issue-16621

Fix link HTML messed up in Advisor
This commit is contained in:
Maurício Meneghini Fauth 2021-02-07 13:35:59 -03:00 committed by GitHub
commit 00be6fda78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -345,7 +345,7 @@ class Advisor
// 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);
},

View File

@ -259,15 +259,18 @@ class AdvisorTest extends AbstractTestCase
'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,