Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -112,6 +112,8 @@ |
113 | 113 | global $wgCheckFileExtensions, $wgStrictFileExtensions; |
114 | 114 | global $wgFileExtensions, $wgFileBlacklist, $wgUploadSizeWarning; |
115 | 115 | |
| 116 | + /** When using detailed copyright, if user filled field, assume he |
| 117 | + * confirmed the upload */ |
116 | 118 | if ( $wgUseCopyrightUpload ) { |
117 | 119 | $this->mUploadAffirm = 1; |
118 | 120 | if ($wgCheckCopyrightUpload && |
— | — | @@ -120,12 +122,13 @@ |
121 | 123 | } |
122 | 124 | } |
123 | 125 | |
| 126 | + /** User need to confirm his upload */ |
124 | 127 | if ( $this->mUploadAffirm != 1) { |
125 | 128 | $this->mainUploadForm( WfMsg( 'noaffirmation' ) ); |
126 | 129 | return; |
127 | 130 | } |
128 | 131 | |
129 | | - if ( '' != $this->mOname ) { |
| 132 | + if ( $this->mOname != '' ) { |
130 | 133 | $basename = strrchr( $this->mOname, '/' ); |
131 | 134 | |
132 | 135 | if ( false === $basename ) { $basename = $this->mOname; } |
— | — | @@ -152,7 +155,6 @@ |
153 | 156 | $basename = $bn; |
154 | 157 | } |
155 | 158 | |
156 | | - |
157 | 159 | $nt = Title::newFromText( $basename ); |
158 | 160 | if( !$nt ) { |
159 | 161 | return $this->uploadError( wfMsg( 'illegalfilename', htmlspecialchars( $basename ) ) ); |
— | — | @@ -196,6 +198,9 @@ |
197 | 199 | } |
198 | 200 | if($warning != '') return $this->uploadWarning($warning); |
199 | 201 | } |
| 202 | + } else { |
| 203 | + return $this->uploadError('<li>'.wfMsg( 'emptyfile' ).'</li>'); |
| 204 | + |
200 | 205 | } |
201 | 206 | if ( !is_null( $this->mUploadOldVersion ) ) { |
202 | 207 | $wgUploadOldVersion = $this->mUploadOldVersion; |