Merge "Move around "ا" to after "آ" and not before"
[lhc/web/wiklou.git] / includes / api / ApiUpload.php
index 6b38302..cfe1968 100644 (file)
@@ -71,7 +71,7 @@ class ApiUpload extends ApiBase {
                $this->checkPermissions( $user );
 
                // Fetch the file (usually a no-op)
-               /** @var $status Status */
+               /** @var Status $status */
                $status = $this->mUpload->fetchFile();
                if ( !$status->isGood() ) {
                        $this->dieStatus( $status );
@@ -494,6 +494,13 @@ class ApiUpload extends ApiBase {
                                $this->mParams['filekey'], $this->mParams['filename'], !$this->mParams['async']
                        );
                } elseif ( isset( $this->mParams['file'] ) ) {
+                       // Can't async upload directly from a POSTed file, we'd have to
+                       // stash the file and then queue the publish job. The user should
+                       // just submit the two API queries to perform those two steps.
+                       if ( $this->mParams['async'] ) {
+                               $this->dieWithError( 'apierror-cannot-async-upload-file' );
+                       }
+
                        $this->mUpload = new UploadFromFile();
                        $this->mUpload->initialize(
                                $this->mParams['filename'],
@@ -765,7 +772,7 @@ class ApiUpload extends ApiBase {
                        $this->mParams['text'] = $this->mParams['comment'];
                }
 
-               /** @var $file LocalFile */
+               /** @var LocalFile $file */
                $file = $this->mUpload->getLocalFile();
 
                // For preferences mode, we want to watch if 'watchdefault' is set,
@@ -822,7 +829,7 @@ class ApiUpload extends ApiBase {
                        $result['result'] = 'Poll';
                        $result['stage'] = 'queued';
                } else {
-                       /** @var $status Status */
+                       /** @var Status $status */
                        $status = $this->mUpload->performUpload( $this->mParams['comment'],
                                $this->mParams['text'], $watch, $this->getUser(), $this->mParams['tags'] );
 
@@ -921,6 +928,6 @@ class ApiUpload extends ApiBase {
        }
 
        public function getHelpUrls() {
-               return 'https://www.mediawiki.org/wiki/API:Upload';
+               return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Upload';
        }
 }