Merge "TitleInputWidget: Correct links when 'relative' option used"
[lhc/web/wiklou.git] / includes / specials / SpecialUploadStash.php
index 462dbee..ad329d3 100644 (file)
@@ -48,10 +48,6 @@ class SpecialUploadStash extends UnlistedSpecialPage {
 
        public function __construct() {
                parent::__construct( 'UploadStash', 'upload' );
-               try {
-                       $this->stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
-               } catch ( UploadStashNotAvailableException $e ) {
-               }
        }
 
        /**
@@ -62,6 +58,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * @return bool Success
         */
        public function execute( $subPage ) {
+               $this->stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
                $this->checkPermissions();
 
                if ( $subPage === null || $subPage === '' ) {
@@ -229,7 +226,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         */
        private function outputRemoteScaledThumb( $file, $params, $flags ) {
                // This option probably looks something like
-               // 'http://upload.wikimedia.org/wikipedia/test/thumb/temp'. Do not use
+               // '//upload.wikimedia.org/wikipedia/test/thumb/temp'. Do not use
                // trailing slash.
                $scalerBaseUrl = $this->getConfig()->get( 'UploadStashScalerBaseUrl' );
 
@@ -250,9 +247,9 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                // make a curl call to the scaler to create a thumbnail
                $httpOptions = array(
                        'method' => 'GET',
-                       'timeout' => 'default'
+                       'timeout' => 5 // T90599 attempt to time out cleanly
                );
-               $req = MWHttpRequest::factory( $scalerThumbUrl, $httpOptions );
+               $req = MWHttpRequest::factory( $scalerThumbUrl, $httpOptions, __METHOD__ );
                $status = $req->execute();
                if ( !$status->isOK() ) {
                        $errors = $status->getErrorsArray();