* Allow developers to set HTML gallery captions with ImageGallery::setCaptionSafe()
* (bug 8489) Support basic links in <gallery> caption attribute
$wgDisableQueryPageUpdate
* (bug 8413) Improve comments for $wgNamespaceRobotPolicies
* (bug 8330) Show "bytes" suffix on recent changes diff counter
+* (bug 8489) Support basic links in <gallery> caption attribute
== Languages updated ==
}
/**
- * Set the caption
+ * Set the caption (as plain text)
*
* @param $caption Caption
*/
function setCaption( $caption ) {
+ $this->mCaption = htmlspecialchars( $caption );
+ }
+
+ /**
+ * Set the caption (as HTML)
+ *
+ * @param $caption Caption
+ */
+ function setCaptionSafe( $caption ) {
$this->mCaption = $caption;
}
$s = '<table class="gallery" cellspacing="0" cellpadding="0">';
if( $this->mCaption )
- $s .= '<td class="galleryheader" colspan="4"><big>' . htmlspecialchars( $this->mCaption ) . '</big></td>';
+ $s .= '<td class="galleryheader" colspan="4"><big>' . $this->mCaption . '</big></td>';
$i = 0;
foreach ( $this->mImages as $pair ) {
$ig->setParsing();
$ig->useSkin( $this->mOptions->getSkin() );
- if( isset( $params['caption'] ) )
- $ig->setCaption( $params['caption'] );
+ if( isset( $params['caption'] ) ) {
+ $caption = $params['caption'];
+ $caption = htmlspecialchars( $caption );
+ $caption = $this->replaceInternalLinks( $caption );
+ $ig->setCaptionSafe( $caption );
+ }
$lines = explode( "\n", $text );
foreach ( $lines as $line ) {