From 85d3e2b76a3be305f2ccbc6d5a6d309ab89c675a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= <mic.grosse@googlemail.com> Date: Sun, 27 Aug 2017 19:48:39 +0200 Subject: [PATCH] fix: check if key is set to fix PHP Notice If a key is not set, a PHP Notice is triggered. While these are currently suppressed, this is still a code smell. --- lib/plugins/extension/helper/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 6ca72f7ce..656b4ea09 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -340,9 +340,9 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $link = parse_url($url); $base = $link['host']; - if($link['port']) $base .= $base.':'.$link['port']; + if(!empty($link['port'])) $base .= $base.':'.$link['port']; $long = $link['path']; - if($link['query']) $long .= $link['query']; + if(!empty($link['query'])) $long .= $link['query']; $name = shorten($base, $long, 55); -- GitLab