Index: branches/wmf/1.16wmf4/includes/specials/SpecialUpload.php |
— | — | @@ -308,10 +308,15 @@ |
309 | 309 | protected function showUploadWarning( $warnings ) { |
310 | 310 | global $wgUser; |
311 | 311 | |
312 | | - # If there are no warnings, or warnings we can ignore, return early |
| 312 | + # If there are no warnings, or warnings we can ignore, return early. |
| 313 | + # mDestWarningAck is set when some javascript has shown the warning |
| 314 | + # to the user. mForReUpload is set when the user clicks the "upload a |
| 315 | + # new version" link. |
313 | 316 | if ( !$warnings || ( count( $warnings ) == 1 && |
314 | | - isset( $warnings['exists']) && $this->mDestWarningAck ) ) { |
315 | | - return false; |
| 317 | + isset( $warnings['exists'] ) && |
| 318 | + ( $this->mDestWarningAck || $this->mForReUpload ) ) ) |
| 319 | + { |
| 320 | + return false; |
316 | 321 | } |
317 | 322 | |
318 | 323 | $sessionKey = $this->mUpload->stashSession(); |
— | — | @@ -930,7 +935,7 @@ |
931 | 936 | protected function getOptionsSection() { |
932 | 937 | global $wgUser, $wgOut; |
933 | 938 | |
934 | | - if( $wgUser->isLoggedIn() ) { |
| 939 | + if ( $wgUser->isLoggedIn() ) { |
935 | 940 | $descriptor = array( |
936 | 941 | 'Watchthis' => array( |
937 | 942 | 'type' => 'check', |
— | — | @@ -941,7 +946,7 @@ |
942 | 947 | ) |
943 | 948 | ); |
944 | 949 | } |
945 | | - if( !$this->mHideIgnoreWarning ) { |
| 950 | + if ( !$this->mHideIgnoreWarning ) { |
946 | 951 | $descriptor['IgnoreWarning'] = array( |
947 | 952 | 'type' => 'check', |
948 | 953 | 'id' => 'wpIgnoreWarning', |
— | — | @@ -950,11 +955,19 @@ |
951 | 956 | ); |
952 | 957 | } |
953 | 958 | |
954 | | - $descriptor['wpDestFileWarningAck'] = array( |
| 959 | + $descriptor['DestFileWarningAck'] = array( |
955 | 960 | 'type' => 'hidden', |
956 | 961 | 'id' => 'wpDestFileWarningAck', |
957 | 962 | 'default' => $this->mDestWarningAck ? '1' : '', |
958 | 963 | ); |
| 964 | + |
| 965 | + if ( $this->mForReUpload ) { |
| 966 | + $descriptor['ForReUpload'] = array( |
| 967 | + 'type' => 'hidden', |
| 968 | + 'id' => 'wpForReUpload', |
| 969 | + 'default' => '1', |
| 970 | + ); |
| 971 | + } |
959 | 972 | |
960 | 973 | return $descriptor; |
961 | 974 | |