From ed357d77164f7dfe27741cfa9935cdf21489368a Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 17 Jun 2015 08:48:14 +0530 Subject: [PATCH] bug External URL for $cfg['NavigationLogoLink'] causes JavaScript error when clicked Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + doc/config.rst | 6 +++--- libraries/navigation/NavigationHeader.class.php | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03d5c404c5..785ee98abc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ phpMyAdmin - ChangeLog - bug #4961 Javascript error when Designer is opened - bug #4962 Insert by foreign key scrolls page to top - bug #4955 Clicking on the navi logo does not always work +- bug External URL for $cfg['NavigationLogoLink'] causes JavaScript error when clicked 4.4.9.0 (2015-06-04) - bug #4920 relation view doesn't list fields of table in other database diff --git a/doc/config.rst b/doc/config.rst index 6d8ed5104a..6d81f63c1a 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1524,9 +1524,9 @@ Navigation panel setup :type: string :default: ``'index.php'`` - Enter :term:`URL` where logo in the - navigation panel will point to. For use especially with self made - theme which changes this. + Enter :term:`URL` where logo in the navigation panel will point to. + For use especially with self made theme which changes this. + For external :term:`URL`s, you should include URL scheme as well. .. config:option:: $cfg['NavigationLogoLinkWindow'] diff --git a/libraries/navigation/NavigationHeader.class.php b/libraries/navigation/NavigationHeader.class.php index b9d48c0c64..73a6dafb92 100644 --- a/libraries/navigation/NavigationHeader.class.php +++ b/libraries/navigation/NavigationHeader.class.php @@ -107,10 +107,10 @@ class PMA_NavigationHeader break; case 'main': // do not add our parameters for an external link - $navLogoLinkLower = /*overload*/mb_strtolower( - $GLOBALS['cfg']['NavigationLogoLink'] + $host = parse_url( + $GLOBALS['cfg']['NavigationLogoLink'], PHP_URL_HOST ); - if (/*overload*/mb_substr($navLogoLinkLower, 0, 4) !== '://') { + if (empty($host)) { $retval .= PMA_URL_getCommon() . '"'; } else { $retval .= '" target="_blank"';