Index: trunk/extensions/FlaggedRevs/frontend/specialpages/actions/Stabilization_body.php |
— | — | @@ -113,10 +113,10 @@ |
114 | 114 | $showProtectOptions = ( $scExpiryOptions !== '-' && $form->isAllowed() ); |
115 | 115 | $dropdownOptions = array(); // array of <label,value> |
116 | 116 | # Add the current expiry as a dropdown option |
117 | | - if ( $oldConfig['expiry'] && $oldConfig['expiry'] != Block::infinity() ) { |
118 | | - $timestamp = $this->getLang()->timeanddate( $oldConfig['expiry'] ); |
119 | | - $d = $this->getLang()->date( $oldConfig['expiry'] ); |
120 | | - $t = $this->getLang()->time( $oldConfig['expiry'] ); |
| 117 | + if ( $oldConfig['expiry'] && $oldConfig['expiry'] != 'infinity' ) { |
| 118 | + $timestamp = $this->getLanguage()->timeanddate( $oldConfig['expiry'] ); |
| 119 | + $d = $this->getLanguage()->date( $oldConfig['expiry'] ); |
| 120 | + $t = $this->getLanguage()->time( $oldConfig['expiry'] ); |
121 | 121 | $dropdownOptions[] = array( |
122 | 122 | wfMsg( 'protect-existing-expiry', $timestamp, $d, $t ), 'existing' ); |
123 | 123 | } |
— | — | @@ -239,7 +239,7 @@ |
240 | 240 | </tr>' . Xml::closeElement( 'table' ) . |
241 | 241 | Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . |
242 | 242 | Html::hidden( 'page', $title->getPrefixedText() ) . |
243 | | - Html::hidden( 'wpEditToken', $this->getUser()->editToken() ); |
| 243 | + Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() ); |
244 | 244 | } else { |
245 | 245 | $s .= Xml::closeElement( 'table' ); |
246 | 246 | } |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/StablePages_body.php |
— | — | @@ -153,7 +153,7 @@ |
154 | 154 | $conds['page_namespace'] = $this->namespace; |
155 | 155 | // Be sure not to include expired items |
156 | 156 | if( $this->indef ) { |
157 | | - $conds['fpc_expiry'] = Block::infinity(); |
| 157 | + $conds['fpc_expiry'] = $this->mDb->getInfinity(); |
158 | 158 | } else { |
159 | 159 | $encCutoff = $this->mDb->addQuotes( $this->mDb->timestamp() ); |
160 | 160 | $conds[] = "fpc_expiry > {$encCutoff}"; |
Index: trunk/extensions/FlaggedRevs/backend/FRPageConfig.php |
— | — | @@ -32,8 +32,7 @@ |
33 | 33 | */ |
34 | 34 | public static function getVisibilitySettingsFromRow( $row ) { |
35 | 35 | if ( $row ) { |
36 | | - # This code should be refactored, now that it's being used more generally. |
37 | | - $expiry = Block::decodeExpiry( $row->fpc_expiry ); |
| 36 | + $expiry = wfGetDB( DB_SLAVE )->decodeExpiry( $row->fpc_expiry ); |
38 | 37 | # Only apply the settings if they haven't expired |
39 | 38 | if ( !$expiry || $expiry < wfTimestampNow() ) { |
40 | 39 | $row = null; // expired |
— | — | @@ -49,7 +48,7 @@ |
50 | 49 | $config = array( |
51 | 50 | 'override' => $row->fpc_override ? 1 : 0, |
52 | 51 | 'autoreview' => $level, |
53 | | - 'expiry' => Block::decodeExpiry( $row->fpc_expiry ) // TS_MW |
| 52 | + 'expiry' => $expiry // TS_MW |
54 | 53 | ); |
55 | 54 | # If there are protection levels defined check if this is valid... |
56 | 55 | if ( FlaggedRevs::useProtectionLevels() ) { |
— | — | @@ -96,7 +95,7 @@ |
97 | 96 | $changed = ( $dbw->affectedRows() != 0 ); // did this do anything? |
98 | 97 | # Otherwise, add/replace row if we are not just setting it to the site default |
99 | 98 | } else { |
100 | | - $dbExpiry = Block::encodeExpiry( $config['expiry'], $dbw ); |
| 99 | + $dbExpiry = $dbw->encodeExpiry( $config['expiry'] ); |
101 | 100 | # Get current config... |
102 | 101 | $oldRow = $dbw->selectRow( 'flaggedpage_config', |
103 | 102 | array( 'fpc_override', 'fpc_level', 'fpc_expiry' ), |
Index: trunk/extensions/FlaggedRevs/business/PageStabilityForm.php |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | $value = $this->expirySelection; |
89 | 89 | } |
90 | 90 | if ( $value == 'infinite' || $value == 'indefinite' || $value == 'infinity' ) { |
91 | | - $time = Block::infinity(); |
| 91 | + $time = 'infinity'; |
92 | 92 | } else { |
93 | 93 | $unix = strtotime( $value ); |
94 | 94 | # On error returns -1 for PHP <5.1 and false for PHP >=5.1 |
— | — | @@ -188,7 +188,7 @@ |
189 | 189 | */ |
190 | 190 | public function doPreloadParameters() { |
191 | 191 | $oldConfig = $this->getOldConfig(); |
192 | | - if ( $oldConfig['expiry'] == Block::infinity() ) { |
| 192 | + if ( $oldConfig['expiry'] == 'infinity' ) { |
193 | 193 | $this->expirySelection = 'infinite'; // no settings set OR indefinite |
194 | 194 | } else { |
195 | 195 | $this->expirySelection = 'existing'; // settings set and NOT indefinite |
— | — | @@ -217,7 +217,7 @@ |
218 | 218 | $expiry = $this->getExpiry(); |
219 | 219 | if ( $expiry === false ) { |
220 | 220 | return 'stabilize_expiry_invalid'; |
221 | | - } elseif ( $expiry !== Block::infinity() && $expiry < wfTimestampNow() ) { |
| 221 | + } elseif ( $expiry !== 'infinity' && $expiry < wfTimestampNow() ) { |
222 | 222 | return 'stabilize_expiry_old'; |
223 | 223 | } |
224 | 224 | # Update the DB row with the new config... |