http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70089

Revision: 70089
Author:   btongminh
Date:     2010-07-28 13:43:38 +0000 (Wed, 28 Jul 2010)

Log Message:
-----------
Style fixes on UploadFromUrl.php

Modified Paths:
--------------
    trunk/phase3/includes/upload/UploadFromUrl.php

Modified: trunk/phase3/includes/upload/UploadFromUrl.php
===================================================================
--- trunk/phase3/includes/upload/UploadFromUrl.php      2010-07-28 13:28:48 UTC 
(rev 70088)
+++ trunk/phase3/includes/upload/UploadFromUrl.php      2010-07-28 13:43:38 UTC 
(rev 70089)
@@ -17,7 +17,7 @@
         * user is allowed, pass on permissions checking to the parent.
         */
        public static function isAllowed( $user ) {
-               if( !$user->isAllowed( 'upload_by_url' ) )
+               if ( !$user->isAllowed( 'upload_by_url' ) )
                        return 'upload_by_url';
                return parent::isAllowed( $user );
        }
@@ -35,28 +35,27 @@
         * Entry point for API upload
         * @return bool true on success
         */
-       public function initialize( $name, $url, $comment, $watchList = null, 
$ignoreWarn = null, $async = 'async') {
+       public function initialize( $name, $url, $comment, $watchList = null, 
$ignoreWarn = null, $async = 'async' ) {
                global $wgUser;
 
-               if( !Http::isValidURI( $url ) ) {
+               if ( !Http::isValidURI( $url ) ) {
                        return Status::newFatal( 'http-invalid-url' );
                }
                $params = array(
-                       "userName" => $wgUser->getName(),
-                       "userID" => $wgUser->getID(),
-                       "url" => trim( $url ),
-                       "timestamp" => wfTimestampNow(),
-                       "comment" => $comment,
-                       "watchlist" => $watchList,
-                       "ignorewarnings" => $ignoreWarn);
+                       'userName' => $wgUser->getName(),
+                       'userID' => $wgUser->getID(),
+                       'url' => trim( $url ),
+                       'timestamp' => wfTimestampNow(),
+                       'comment' => $comment,
+                       'watchlist' => $watchList,
+                       'ignorewarnings' => $ignoreWarn );
 
                $title = Title::newFromText( $name );
 
                if ( $async == 'async' ) {
                        $job = new UploadFromUrlJob( $title, $params );
                        return $job->insert();
-               }
-               else {
+               } else {
                        $this->mUrl = trim( $url );
                        $this->comment = $comment;
                        $this->watchList = $watchList;
@@ -90,7 +89,7 @@
         */
        public function initializeFromRequest( &$request ) {
                $desiredDestName = $request->getText( 'wpDestFile' );
-               if( !$desiredDestName )
+               if ( !$desiredDestName )
                        $desiredDestName = $request->getText( 'wpUploadFileURL' 
);
                return $this->initialize(
                        $desiredDestName,
@@ -105,7 +104,7 @@
        /**
         * @param $request Object: WebRequest object
         */
-       public static function isValidRequest( $request ){
+       public static function isValidRequest( $request ) {
                global $wgUser;
 
                $url = $request->getVal( 'wpUploadFileURL' );
@@ -130,10 +129,10 @@
        }
 
        public function retrieveFileFromUrl() {
-               $req = HttpRequest::factory($this->mUrl);
+               $req = HttpRequest::factory( $this->mUrl );
                $status = $req->execute();
 
-               if( !$status->isOk() ) {
+               if ( !$status->isOk() ) {
                        return $status;
                }
 
@@ -154,7 +153,7 @@
                if ( $status->isGood() ) {
 
                        $v = $this->verifyUpload();
-                       if( $v['status'] !== UploadBase::OK ) {
+                       if ( $v['status'] !== UploadBase::OK ) {
                                return $this->convertVerifyErrorToStatus( 
$v['status'], $v['details'] );
                        }
 



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to