Add broken-file-category for file links inside <gallery/>
authorMatmaRex <matma.rex@gmail.com>
Mon, 24 Jun 2013 18:38:48 +0000 (20:38 +0200)
committerMatmaRex <matma.rex@gmail.com>
Mon, 24 Jun 2013 18:38:48 +0000 (20:38 +0200)
Bug: 50119
Change-Id: I7d06f48e53df43213bda52feec0d3f390e10f742

includes/ImageGallery.php

index 43cf7f6..5b45404 100644 (file)
@@ -286,6 +286,10 @@ class ImageGallery {
                                # We're dealing with a non-image, spit out the name and be done with it.
                                $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">'
                                        . htmlspecialchars( $nt->getText() ) . '</div>';
+
+                               if ( $this->mParser instanceof Parser ) {
+                                       $this->mParser->addTrackingCategory( 'broken-file-category' );
+                               }
                        } elseif ( $this->mHideBadImages && wfIsBadImage( $nt->getDBkey(), $this->getContextTitle() ) ) {
                                # The image is blacklisted, just show it as a text link.
                                $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">' .