r53341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53340‎ | r53341 | r53342 >
Date:23:00, 15 July 2009
Author:dale
Status:ok
Tags:
Comment:
Some Strict Standards fixes per r53282 c3194
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromUrl.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromUrl.php
@@ -3,7 +3,7 @@
44 class UploadFromUrl extends UploadBase {
55 protected $mTempDownloadPath;
66
7 - // by default do a SYNC_DOWNLOAD
 7+ // by default do a SYNC_DOWNLOAD
88 protected $dl_mode = null;
99
1010 /**
@@ -24,12 +24,12 @@
2525 }
2626
2727 /* entry point for API upload:: ASYNC_DOWNLOAD (if possible) */
28 - function initialize( $name, $url, $asyncdownload = false ) {
29 - global $wgTmpDirectory, $wgPhpCliPath;
 28+ function initialize( $name, $url, $asyncdownload, $na = false ) {
 29+ global $wgTmpDirectory, $wgPhpCli;
3030
31 - // check for $asyncdownload request:
 31+ // check for $asyncdownload request:
3232 if( $asyncdownload !== false){
33 - if( $wgPhpCliPath && wfShellExecEnabled() ){
 33+ if( $wgPhpCli && wfShellExecEnabled() ){
3434 $this->dl_mode = Http::ASYNC_DOWNLOAD;
3535 } else {
3636 $this->dl_mode = Http::SYNC_DOWNLOAD;
@@ -54,7 +54,7 @@
5555
5656 // set dl mode if not set:
5757 if( !$this->dl_mode )
58 - $this->dl_mode = Http::SYNC_DOWNLOAD;
 58+ $this->dl_mode = Http::SYNC_DOWNLOAD;
5959
6060 $desiredDestName = $request->getText( 'wpDestFile' );
6161 if( !$desiredDestName )
@@ -69,7 +69,7 @@
7070 * Do the real fetching stuff
7171 */
7272 function fetchFile() {
73 - // entry point for SpecialUplaod
 73+ // entry point for SpecialUplaod
7474 if( self::isValidURI( $this->mUrl ) === false ) {
7575 return Status::newFatal( 'upload-proto-error' );
7676 }
@@ -77,7 +77,7 @@
7878 // now do the actual download to the target file:
7979 $status = Http::doDownload( $this->mUrl, $this->mTempPath, $this->dl_mode );
8080
81 - // update the local filesize var:
 81+ // update the local filesize var:
8282 $this->mFileSize = filesize( $this->mTempPath );
8383
8484 return $status;
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -24,6 +24,7 @@
2525 var $uploadFormTextTop;
2626 var $uploadFormTextAfterSummary;
2727 var $mTokenOk = false;
 28+ var $mForReUpload = false;
2829 /**#@-*/
2930
3031 /**
@@ -74,6 +75,7 @@
7576 $this->mDestWarningAck = $request->getText( 'wpDestFileWarningAck' );
7677
7778 $this->mForReUpload = $request->getBool( 'wpForReUpload' );
 79+
7880 $this->mReUpload = $request->getCheck( 'wpReUpload' );
7981
8082 $this->mAction = $request->getVal( 'action' );
@@ -752,7 +754,7 @@
753755 $sourcefilename = wfMsgExt( 'sourcefilename', array( 'parseinline', 'escapenoentities' ) );
754756 $destfilename = wfMsgExt( 'destfilename', array( 'parseinline', 'escapenoentities' ) );
755757
756 - $msg = $this->mForReUpload ? 'filereuploadsummary' : 'fileuploadsummary';
 758+ $msg = ( $this->mForReUpload ) ? 'filereuploadsummary' : 'fileuploadsummary';
757759 $summary = wfMsgExt( $msg, 'parseinline' );
758760
759761 $licenses = new Licenses();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r53282here it is ... the upload-api, script-server, js2 (javascript phase2) branch ...dale23:52, 14 July 2009

Status & tagging log