diff --git a/ChangeLog b/ChangeLog
index a7f69535e9..6a01fe9e23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/libraries/classes/Advisor.php b/libraries/classes/Advisor.php
index a3981a0e46..182bef7cb7 100644
--- a/libraries/classes/Advisor.php
+++ b/libraries/classes/Advisor.php
@@ -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);
},
diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php
index 9c5385b52b..00af71697d 100644
--- a/test/classes/AdvisorTest.php
+++ b/test/classes/AdvisorTest.php
@@ -259,15 +259,18 @@ class AdvisorTest extends AbstractTestCase
'justification_formula' => 'ADVISOR_formatByteDown(1000000, 2, 2)',
'name' => 'Distribution',
'issue' => 'official MySQL binaries.',
- 'recommendation' => 'See web',
+ 'recommendation' => 'See web and'
+ . ' web2',
],
[
'justification' => 'Memory: 0.95 MiB',
'justification_formula' => 'ADVISOR_formatByteDown(1000000, 2, 2)',
'name' => 'Distribution',
'issue' => 'official MySQL binaries.',
- 'recommendation' => 'See web',
+ 'recommendation' => 'See web'
+ . ' and web2',
'id' => 'Distribution',
],
null,