Avoid undefined index on Special:Tags
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 19 Jun 2015 18:10:41 +0000 (20:10 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 19 Jun 2015 18:10:41 +0000 (20:10 +0200)
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

index b2305b9..a6847e1 100644 (file)
@@ -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();
                }