Parse 'upload_source_url' message on SpecialUpload
[lhc/web/wiklou.git] / includes / specials / SpecialUpload.php
index 13a00ed..77ad9aa 100644 (file)
@@ -738,6 +738,18 @@ class SpecialUpload extends SpecialPage {
        protected function getGroupName() {
                return 'media';
        }
+
+       /**
+        * Should we rotate images in the preview on Special:Upload.
+        *
+        * This controls js: mw.config.get( 'wgFileCanRotate' )
+        *
+        * @todo What about non-BitmapHandler handled files?
+        */
+       public static function rotationEnabled() {
+               $bitmapHandler = new BitmapHandler();
+               return $bitmapHandler->autoRotateEnabled();
+       }
 }
 
 /**
@@ -891,7 +903,7 @@ class UploadForm extends HTMLForm {
                                        $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['url'] )
                                )->parse() .
                                        $this->msg( 'word-separator' )->escaped() .
-                                       $this->msg( 'upload_source_url' )->escaped(),
+                                       $this->msg( 'upload_source_url' )->parse(),
                                'checked' => $selectedSourceType == 'url',
                        );
                }
@@ -1130,6 +1142,7 @@ class UploadForm extends HTMLForm {
                        'wgStrictFileExtensions' => $config->get( 'StrictFileExtensions' ),
                        'wgCapitalizeUploads' => MWNamespace::isCapitalized( NS_FILE ),
                        'wgMaxUploadSize' => $this->mMaxUploadSize,
+                       'wgFileCanRotate' => SpecialUpload::rotationEnabled(),
                );
 
                $out = $this->getOutput();