From 63408b4a434b23dd06a477186eda5fb6c361b24a Mon Sep 17 00:00:00 2001 From: Wil Mahan Date: Tue, 12 Oct 2004 00:12:06 +0000 Subject: [PATCH] Add "longdesc" attribute to all (non-external) images, containing the URL of the image page. --- includes/Image.php | 9 +++++++++ includes/Skin.php | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index 025c13f38c..abc4d0827d 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -195,6 +195,15 @@ class Image return $this->title->escapeLocalURL(); } + /** + * Return the escapeFullURL of this image + * @access public + */ + function getEscapeFullURL() + { + return $this->title->escapeFullURL(); + } + /** * Return the URL of an image, provided its name. * diff --git a/includes/Skin.php b/includes/Skin.php index 41fa58a9b0..0a6a497a5b 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1781,13 +1781,14 @@ class Skin { $alt = str_replace( array('<', '>', '"'), array('<', '>', '"'), $alt ); $u = $nt->escapeLocalURL(); + $uf = $nt->escapeFullURL(); if ( $url == '' ) { $s = wfMsg( 'missingimage', $img->getName() ); $s .= "
{$alt}
{$url}
\n"; } else { $s = '' . - ''.$alt.''; + ''.$alt.''; } if ( '' != $align ) { $s = "
{$s}
"; @@ -1858,6 +1859,7 @@ class Skin { } $u = $img->getEscapeLocalURL(); + $uf = $img->getEscapeFullURL(); $more = htmlspecialchars( wfMsg( 'thumbnail-more' ) ); $magnifyalign = $wgContLang->isRTL() ? 'left' : 'right'; @@ -1870,7 +1872,8 @@ class Skin { } else { $s .= ''. ''.$alt.''; + 'width="'.$boxwidth.'" height="'.$boxheight.'" ' . + 'longdesc="'.$uf.'" />'; if ( $framed ) { $zoomicon=""; } else { -- 2.20.1