From 72a077773a7b429f06c5de7933e66e654f2cb739 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Fri, 19 Jun 2015 20:10:41 +0200 Subject: [PATCH] Avoid undefined index on Special:Tags An never used tag would not get returned by ChangeTags::tagUsageStatistics and can raise an undefined index notice: Undefined index: Test in \includes\specials\SpecialTags.php on line 340 Change-Id: I323f047e20a8f66e381b76d505f3b48123bfdf55 --- includes/specials/SpecialTags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index b2305b9f16..a6847e19d1 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -337,7 +337,7 @@ class SpecialTags extends SpecialPage { $preText = $this->msg( 'tags-delete-explanation-initial', $tag )->parseAsBlock(); $tagUsage = ChangeTags::tagUsageStatistics(); - if ( $tagUsage[$tag] > 0 ) { + if ( isset( $tagUsage[$tag] ) && $tagUsage[$tag] > 0 ) { $preText .= $this->msg( 'tags-delete-explanation-in-use', $tag, $tagUsage[$tag] )->parseAsBlock(); } -- 2.20.1