Index: trunk/phase3/includes/upload/UploadFromUrl.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | class UploadFromUrl extends UploadBase { |
5 | 5 | protected $mTempDownloadPath; |
6 | 6 | |
7 | | - // by default do a SYNC_DOWNLOAD |
| 7 | + // by default do a SYNC_DOWNLOAD |
8 | 8 | protected $dl_mode = null; |
9 | 9 | |
10 | 10 | /** |
— | — | @@ -24,12 +24,12 @@ |
25 | 25 | } |
26 | 26 | |
27 | 27 | /* 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; |
30 | 30 | |
31 | | - // check for $asyncdownload request: |
| 31 | + // check for $asyncdownload request: |
32 | 32 | if( $asyncdownload !== false){ |
33 | | - if( $wgPhpCliPath && wfShellExecEnabled() ){ |
| 33 | + if( $wgPhpCli && wfShellExecEnabled() ){ |
34 | 34 | $this->dl_mode = Http::ASYNC_DOWNLOAD; |
35 | 35 | } else { |
36 | 36 | $this->dl_mode = Http::SYNC_DOWNLOAD; |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | |
56 | 56 | // set dl mode if not set: |
57 | 57 | if( !$this->dl_mode ) |
58 | | - $this->dl_mode = Http::SYNC_DOWNLOAD; |
| 58 | + $this->dl_mode = Http::SYNC_DOWNLOAD; |
59 | 59 | |
60 | 60 | $desiredDestName = $request->getText( 'wpDestFile' ); |
61 | 61 | if( !$desiredDestName ) |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | * Do the real fetching stuff |
71 | 71 | */ |
72 | 72 | function fetchFile() { |
73 | | - // entry point for SpecialUplaod |
| 73 | + // entry point for SpecialUplaod |
74 | 74 | if( self::isValidURI( $this->mUrl ) === false ) { |
75 | 75 | return Status::newFatal( 'upload-proto-error' ); |
76 | 76 | } |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | // now do the actual download to the target file: |
79 | 79 | $status = Http::doDownload( $this->mUrl, $this->mTempPath, $this->dl_mode ); |
80 | 80 | |
81 | | - // update the local filesize var: |
| 81 | + // update the local filesize var: |
82 | 82 | $this->mFileSize = filesize( $this->mTempPath ); |
83 | 83 | |
84 | 84 | return $status; |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | var $uploadFormTextTop; |
26 | 26 | var $uploadFormTextAfterSummary; |
27 | 27 | var $mTokenOk = false; |
| 28 | + var $mForReUpload = false; |
28 | 29 | /**#@-*/ |
29 | 30 | |
30 | 31 | /** |
— | — | @@ -74,6 +75,7 @@ |
75 | 76 | $this->mDestWarningAck = $request->getText( 'wpDestFileWarningAck' ); |
76 | 77 | |
77 | 78 | $this->mForReUpload = $request->getBool( 'wpForReUpload' ); |
| 79 | + |
78 | 80 | $this->mReUpload = $request->getCheck( 'wpReUpload' ); |
79 | 81 | |
80 | 82 | $this->mAction = $request->getVal( 'action' ); |
— | — | @@ -752,7 +754,7 @@ |
753 | 755 | $sourcefilename = wfMsgExt( 'sourcefilename', array( 'parseinline', 'escapenoentities' ) ); |
754 | 756 | $destfilename = wfMsgExt( 'destfilename', array( 'parseinline', 'escapenoentities' ) ); |
755 | 757 | |
756 | | - $msg = $this->mForReUpload ? 'filereuploadsummary' : 'fileuploadsummary'; |
| 758 | + $msg = ( $this->mForReUpload ) ? 'filereuploadsummary' : 'fileuploadsummary'; |
757 | 759 | $summary = wfMsgExt( $msg, 'parseinline' ); |
758 | 760 | |
759 | 761 | $licenses = new Licenses(); |