From 0f463b71f9e99e22910922d71c74e7669417d3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Sat, 6 Feb 2021 18:24:16 -0300 Subject: [PATCH] Fix link HTML messed up in Advisor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- ChangeLog | 1 + libraries/classes/Advisor.php | 2 +- test/classes/AdvisorTest.php | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) 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,