Page MenuHomePhabricator

4198.diff

Authored By
bzimport
Nov 21 2014, 8:57 PM
Size
1003 B
Referenced Files
None
Subscribers
None

4198.diff

Index: maintenance/parserTests.txt
===================================================================
--- maintenance/parserTests.txt (revision 19192)
+++ maintenance/parserTests.txt (working copy)
@@ -3520,6 +3520,15 @@
!! end
!! test
+Media link with fragment (bug 4198)
+!! input
+[[Media:Foobar.jpg#Page=3]]
+!! result
+<p><a href="http://example.com/images/3/3a/Foobar.jpg#Page=3" class="internal" title="Foobar.jpg">Media:Foobar.jpg#Page=3</a>
+</p>
+!! end
+
+!! test
Media link to nonexistent file (bug 1702)
!! input
[[Media:No such.jpg]]
Index: includes/Linker.php
===================================================================
--- includes/Linker.php (revision 19192)
+++ includes/Linker.php (working copy)
@@ -694,7 +694,7 @@
} else {
$img = new Image( $title );
if( $img->exists() ) {
- $url = $img->getURL();
+ $url = $img->getURL() . $title->getFragmentForURL();
$class = 'internal';
} else {
$upload = SpecialPage::getTitleFor( 'Upload' );

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2054
Default Alt Text
4198.diff (1003 B)

Event Timeline