Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php |
— | — | @@ -73,8 +73,13 @@ |
74 | 74 | } |
75 | 75 | |
76 | 76 | // Show form or submit... |
77 | | - if( $this->isAllowed && $isValid && $confirm && $this->submit() ) { |
78 | | - $wgOut->redirect( $this->page->getFullUrl( $query ) ); |
| 77 | + if( $this->isAllowed && $isValid && $confirm ) { |
| 78 | + $status = $this->submit(); |
| 79 | + if( $status === true ) { |
| 80 | + $wgOut->redirect( $this->page->getFullUrl( $query ) ); |
| 81 | + } else { |
| 82 | + $this->showSettings( wfMsg($status) ); |
| 83 | + } |
79 | 84 | } else { |
80 | 85 | $this->showSettings(); |
81 | 86 | } |
— | — | @@ -91,17 +96,18 @@ |
92 | 97 | if( is_null($this->page) ) { |
93 | 98 | return false; // can't continue |
94 | 99 | } |
| 100 | + # Get old config |
| 101 | + $this->config = FlaggedRevs::getPageVisibilitySettings( $this->page, true ); |
| 102 | + # Make user readable date for GET requests |
| 103 | + $this->oldExpiry = $this->config['expiry'] !== 'infinity' ? |
| 104 | + wfTimestamp( TS_RFC2822, $this->config['expiry'] ) : 'infinite'; |
95 | 105 | # If not posted, then fill in existing values/defaults |
96 | 106 | if( !$this->wasPosted ) { |
97 | 107 | # Get visiblity settings... |
98 | | - $this->config = FlaggedRevs::getPageVisibilitySettings( $this->page, true ); |
99 | 108 | $this->select = $this->config['select']; |
100 | 109 | $this->override = $this->config['override']; |
101 | 110 | # Get autoreview restrictions... |
102 | 111 | $this->autoreview = $this->config['autoreview']; |
103 | | - # Make user readable date for GET requests |
104 | | - $this->oldExpiry = $this->config['expiry'] !== 'infinity' ? |
105 | | - wfTimestamp( TS_RFC2822, $this->config['expiry'] ) : 'infinite'; |
106 | 112 | # Handle submission data |
107 | 113 | } else { |
108 | 114 | // Custom expiry takes precedence |
— | — | @@ -356,13 +362,11 @@ |
357 | 363 | # Convert GNU-style date, on error returns -1 for PHP <5.1 and false for PHP >=5.1 |
358 | 364 | $expiry = strtotime( $this->expiry ); |
359 | 365 | if( $expiry < 0 || $expiry === false ) { |
360 | | - $this->showSettings( wfMsg( 'stabilize_expiry_invalid' ) ); |
361 | | - return false; |
| 366 | + return 'stabilize_expiry_invalid'; |
362 | 367 | } |
363 | 368 | $expiry = wfTimestamp( TS_MW, $expiry ); |
364 | 369 | if( $expiry < wfTimestampNow() ) { |
365 | | - $this->showSettings( wfMsg( 'stabilize_expiry_old' ) ); |
366 | | - return false; |
| 370 | + return 'stabilize_expiry_old'; |
367 | 371 | } |
368 | 372 | } |
369 | 373 | |