From 3962a5bc4cced3ea2089c959d6a86d422281948c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 28 Oct 2004 01:10:25 +0000 Subject: [PATCH] Full URLs are not necessary on longdesc; use short URLs like everywhere else. --- includes/Skin.php | 9 +++------ maintenance/parserTests.txt | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 0b2ae7b657..cc14ae28b9 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1778,14 +1778,12 @@ class Skin { $alt = str_replace( array('<', '>', '"'), array('<', '>', '"'), $alt ); $u = $nt->escapeLocalURL(); - $uf = $nt->escapeFullURL(); - if ( $url == '' ) - { + if ( $url == '' ) { $s = wfMsg( 'missingimage', $img->getName() ); $s .= "
{$alt}
{$url}
\n"; } else { $s = '' . - ''.$alt.''; + ''.$alt.''; } if ( '' != $align ) { $s = "
{$s}
"; @@ -1856,7 +1854,6 @@ class Skin { } $u = $img->getEscapeLocalURL(); - $uf = $img->getEscapeFullURL(); $more = htmlspecialchars( wfMsg( 'thumbnail-more' ) ); $magnifyalign = $wgContLang->isRTL() ? 'left' : 'right'; @@ -1870,7 +1867,7 @@ class Skin { $s .= ''. ''.$alt.''; + 'longdesc="'.$u.'" />'; if ( $framed ) { $zoomicon=""; } else { diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 0d1f8c9b29..2d7372e902 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -1435,7 +1435,7 @@ Simple image !! input [[Image:foobar.jpg]] !! result -

Image:foobar.jpg +

Image:foobar.jpg

!! end @@ -1444,7 +1444,7 @@ Right-aligned image !! input [[Image:foobar.jpg|right]] !! result -
+
!! end @@ -1453,7 +1453,7 @@ Image with caption !! input [[Image:foobar.jpg|right|Caption text]] !! result -
Caption text
+
Caption text
!! end @@ -1462,7 +1462,7 @@ Image with frame and link !! input [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] !! result -
This is a test image
This is a test image Main Page
+
This is a test image
This is a test image Main Page
!! end @@ -1480,7 +1480,7 @@ Frameless image caption with a free URL !! input [[Image:foobar.jpg|http://example.com]] !! result -

http://example.com +

http://example.com

!! end @@ -1489,7 +1489,7 @@ Thumbnail image caption with a free URL !! input [[Image:foobar.jpg|thumb|http://example.com]] !! result -
http://example.com
+
http://example.com
!! end @@ -1499,7 +1499,7 @@ BUG 648: Frameless image caption with a link !! input [[Image:foobar.jpg|text with a [[link]] in it]] !! result -

text with a link in it +

text with a link in it

!! end @@ -1508,7 +1508,7 @@ Escape HTML special chars in image alt text !! input [[Image:foobar.jpg|& < > "]] !! result -

& < > " +

& < > "

!! end @@ -1517,7 +1517,7 @@ BUG 499: Alt text should have Ӓ, not &1234; !! input [[Image:foobar.jpg|♀]] !! result -

♀ +

♀

!! end @@ -1535,7 +1535,7 @@ Image caption containing another image !! input [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] !! result -
Missing image
Foobar.jpg
This is a caption with another image inside it!
+
Missing image
Foobar.jpg
This is a caption with another image inside it!
!! end -- 2.20.1