Fixes for (bug 18885), r60593, r60979: The upload link for missing files can now...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Tue, 27 Jul 2010 10:31:30 +0000 (10:31 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Tue, 27 Jul 2010 10:31:30 +0000 (10:31 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/Linker.php

index 8476e4c..6c5a36f 100644 (file)
@@ -46,6 +46,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   uploads in.
 * IBM DB2 database no longer uses the db specific $wgDBport_db2 variable but the
   normal $wgDBport.
+* The upload link for missing files can now be set separately from the 
+  navigation link with $wgUploadMissingFileUrl.
 
 === New features in 1.17 ===
 * (bug 10183) Users can now add personal styles and scripts to all skins via
index ba1c7c5..0c5cfc2 100644 (file)
@@ -436,12 +436,16 @@ $wgMaxUploadSize = 1024*1024*100; # 100MB
  * Useful if you want to use a shared repository by default
  * without disabling local uploads (use $wgEnableUploads = false for that)
  * e.g. $wgUploadNavigationUrl = 'http://commons.wikimedia.org/wiki/Special:Upload';
- *
- * This also affects images inline images that do not exist. In that case the URL will get
- * (?|&)wpDestFile=<filename> appended to it as appropriate.
  */
 $wgUploadNavigationUrl = false;
 
+/**
+ * Point the upload link for missing files to an external URL, as with
+ * $wgUploadNavigationUrl. The URL will get (?|&)wpDestFile=<filename> 
+ * appended to it as appropriate.
+ */
+$wgUploadMissingFileUrl = false;
+
 /**
  * Give a path here to use thumb.php for thumbnail generation on client request, instead of
  * generating them on render and outputting a static URL. This is necessary if some of your
index 008b9b8..1a9e9cf 100644 (file)
@@ -684,11 +684,11 @@ class Linker {
         * @return String
         */
        public function makeBrokenImageLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '', $time = false ) {
-               global $wgEnableUploads, $wgUploadNavigationUrl;
+               global $wgEnableUploads, $wgUploadMissingFileUrl;
                if( $title instanceof Title ) {
                        wfProfileIn( __METHOD__ );
                        $currentExists = $time ? ( wfFindFile( $title ) != false ) : false;
-                       if( ( $wgUploadNavigationUrl || $wgEnableUploads ) && !$currentExists ) {
+                       if( ( $wgUploadMissingFileUrl || $wgEnableUploads ) && !$currentExists ) {
                                if( $text == '' )
                                        $text = htmlspecialchars( $title->getPrefixedText() );
 
@@ -724,13 +724,13 @@ class Linker {
         * @return String: urlencoded URL
         */
        protected function getUploadUrl( $destFile, $query = '' ) {
-               global $wgUploadNavigationUrl;
+               global $wgUploadMissingFileUrl;
                $q = 'wpDestFile=' . $destFile->getPartialUrl();
                if( $query != '' )
                        $q .= '&' . $query;
 
-               if( $wgUploadNavigationUrl ) {
-                       return wfAppendQuery( $wgUploadNavigationUrl, $q );
+               if( $wgUploadMissingFileUrl ) {
+                       return wfAppendQuery( $wgUploadMissingFileUrl, $q );
                } else {
                        $upload = SpecialPage::getTitleFor( 'Upload' );
                        return $upload->getLocalUrl( $q );