From: Kunal Mehta Date: Fri, 20 May 2016 01:53:18 +0000 (-0700) Subject: TraditionalImageGallery: Preload Titles being linked into LinkCache X-Git-Tag: 1.31.0-rc.0~6849^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=b9d4bc7824a4f2a235b913d530f1ee9492793b7d;p=lhc%2Fweb%2Fwiklou.git TraditionalImageGallery: Preload Titles being linked into LinkCache Change-Id: Ie8b2508a52c1c1476f34f0b8e16184bed15310e1 --- diff --git a/includes/gallery/TraditionalImageGallery.php b/includes/gallery/TraditionalImageGallery.php index f00e260e7b..2fb22815d5 100644 --- a/includes/gallery/TraditionalImageGallery.php +++ b/includes/gallery/TraditionalImageGallery.php @@ -59,6 +59,16 @@ class TraditionalImageGallery extends ImageGalleryBase { $output .= "\n\t
  • {$this->mCaption}
  • "; } + if ( $this->mShowFilename ) { + // Preload LinkCache info for when generating links + // of the filename below + $lb = new LinkBatch(); + foreach ( $this->mImages as $img ) { + $lb->addObj( $img[0] ); + } + $lb->execute(); + } + $lang = $this->getRenderLang(); # Output each image... foreach ( $this->mImages as $pair ) { @@ -176,6 +186,7 @@ class TraditionalImageGallery extends ImageGalleryBase { } $textlink = $this->mShowFilename ? + // Preloaded into LinkCache above Linker::linkKnown( $nt, htmlspecialchars( $lang->truncate( $nt->getText(), $this->mCaptionLength ) )