$wgUploadNavigationUrl should be used for file redlinks if $wgUploadMissingFileUrl...
authorRobin Pepermans <robin@users.mediawiki.org>
Tue, 19 Jul 2011 23:09:55 +0000 (23:09 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Tue, 19 Jul 2011 23:09:55 +0000 (23:09 +0000)
RELEASE-NOTES-1.19
includes/Linker.php

index 3143769..5efd328 100644 (file)
@@ -17,6 +17,9 @@ production.
   cache is used.
 
 === Bug fixes in 1.19 ===
+* $wgUploadNavigationUrl should be used for file redlinks if
+  $wgUploadMissingFileUrl is not set. The first was used for this
+  until the second was introduced in 1.17.
 
 === API changes in 1.19 ===
 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
index 1699db6..3ee0aee 100644 (file)
@@ -768,7 +768,7 @@ class Linker {
         * @return String
         */
        public static function makeBrokenImageLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '', $time = false ) {
-               global $wgEnableUploads, $wgUploadMissingFileUrl;
+               global $wgEnableUploads, $wgUploadMissingFileUrl, $wgUploadNavigationUrl;
                if ( ! $title instanceof Title ) {
                        return "<!-- ERROR -->{$prefix}{$text}{$trail}";
                }
@@ -779,7 +779,7 @@ class Linker {
                if ( $text == '' )
                        $text = htmlspecialchars( $title->getPrefixedText() );
 
-               if ( ( $wgUploadMissingFileUrl || $wgEnableUploads ) && !$currentExists ) {
+               if ( ( $wgUploadMissingFileUrl || $wgUploadNavigationUrl || $wgEnableUploads ) && !$currentExists ) {
                        $redir = RepoGroup::singleton()->getLocalRepo()->checkRedirect( $title );
 
                        if ( $redir ) {
@@ -807,13 +807,15 @@ class Linker {
         * @return String: urlencoded URL
         */
        protected static function getUploadUrl( $destFile, $query = '' ) {
-               global $wgUploadMissingFileUrl;
+               global $wgUploadMissingFileUrl, $wgUploadNavigationUrl;
                $q = 'wpDestFile=' . $destFile->getPartialUrl();
                if ( $query != '' )
                        $q .= '&' . $query;
 
                if ( $wgUploadMissingFileUrl ) {
                        return wfAppendQuery( $wgUploadMissingFileUrl, $q );
+               } elseif( $wgUploadNavigationUrl ) {
+                       return wfAppendQuery( $wgUploadNavigationUrl, $q );
                } else {
                        $upload = SpecialPage::getTitleFor( 'Upload' );
                        return $upload->getLocalUrl( $q );