* (bug 14111) Similar filename warning links now lead to correct page
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 13 May 2008 17:40:56 +0000 (17:40 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 13 May 2008 17:40:56 +0000 (17:40 +0000)
A title object was getting created without the Image namespace, so lead to wrong links when used in fileexists-extension warning message. For consistency, using target name with namespace in both spots on that message now as well.

RELEASE-NOTES
includes/SpecialUpload.php

index 3e732d7..fa164f7 100644 (file)
@@ -271,6 +271,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 13943) Fix image redirect behaviour on image pages
 * (bug 14093) Do 'sysop' => 'protect' magic in Title::isValidMoveOperation
 * (bug 14063) Power search form missing <label> for redirects check
+* (bug 14111) Similar filename warning links now lead to correct page
+
 
 === API changes in 1.13 ===
 
index f86efe1..e00030b 100644 (file)
@@ -596,7 +596,7 @@ class UploadForm {
                        // extensions (eg 'jpg' rather than 'JPEG').
                        //
                        // Check for another file using the normalized form...
-                       $nt_lc = Title::newFromText( $partname . '.' . $file->getExtension() );
+                       $nt_lc = Title::makeTitle( NS_IMAGE, $partname . '.' . $file->getExtension() );
                        $file_lc = wfLocalFile( $nt_lc );
                } else {
                        $file_lc = false;
@@ -635,7 +635,10 @@ class UploadForm {
                                $dlink2 = '';
                        }
 
-                       $warning .= '<li>' . wfMsgExt( 'fileexists-extension', 'parsemag', $file->getName(), $dlink ) . '</li>' . $dlink2;
+                       $warning .= '<li>' .
+                               wfMsgExt( 'fileexists-extension', 'parsemag',
+                                       $file->getTitle()->getPrefixedText(), $dlink ) .
+                               '</li>' . $dlink2;
 
                } elseif ( ( substr( $partname , 3, 3 ) == 'px-' || substr( $partname , 2, 3 ) == 'px-' )
                        && ereg( "[0-9]{2}" , substr( $partname , 0, 2) ) )