Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -1171,31 +1171,32 @@ |
1172 | 1172 | __METHOD__ |
1173 | 1173 | ); |
1174 | 1174 | if ( $row ) { |
1175 | | - $now = wfTimestampNow(); |
1176 | 1175 | # This code should be refactored, now that it's being used more generally. |
1177 | 1176 | $expiry = Block::decodeExpiry( $row->fpc_expiry ); |
1178 | 1177 | # Only apply the settings if they haven't expired |
1179 | | - if ( !$expiry || $expiry < $now ) { |
| 1178 | + if ( !$expiry || $expiry < wfTimestampNow() ) { |
1180 | 1179 | $row = null; // expired |
1181 | 1180 | self::purgeExpiredConfigurations(); |
1182 | 1181 | self::titleLinksUpdate( $title ); // re-find stable version |
1183 | 1182 | $title->invalidateCache(); // purge squid/memcached |
1184 | 1183 | } |
1185 | 1184 | } |
1186 | | - # Return the default config if this page doesn't have its own |
1187 | | - if ( !$row ) { |
| 1185 | + // Is there a non-expired row? |
| 1186 | + if ( $row ) { |
| 1187 | + $config = array( |
| 1188 | + 'select' => intval( $row->fpc_select ), |
| 1189 | + 'override' => $row->fpc_override, |
| 1190 | + 'autoreview' => $row->fpc_level, |
| 1191 | + 'expiry' => Block::decodeExpiry( $row->fpc_expiry ) |
| 1192 | + ); |
| 1193 | + # If there are protection levels defined check if this is valid |
| 1194 | + if ( self::useProtectionLevels() && self::getProtectionLevel( $config ) == 'invalid' ) { |
| 1195 | + return self::getDefaultVisibilitySettings(); // revert to none |
| 1196 | + } |
| 1197 | + } else { |
| 1198 | + # Return the default config if this page doesn't have its own |
1188 | 1199 | return self::getDefaultVisibilitySettings(); |
1189 | 1200 | } |
1190 | | - $config = array( |
1191 | | - 'select' => intval( $row->fpc_select ), |
1192 | | - 'override' => $row->fpc_override, |
1193 | | - 'autoreview' => $row->fpc_level, |
1194 | | - 'expiry' => wfTimestamp( TS_MW, $row->fpc_expiry ) |
1195 | | - ); |
1196 | | - # If there are protection levels defined check if this is valid |
1197 | | - if ( self::useProtectionLevels() && self::getProtectionLevel( $config ) == 'invalid' ) { |
1198 | | - return self::getDefaultVisibilitySettings(); // revert to none |
1199 | | - } |
1200 | 1201 | return $config; |
1201 | 1202 | } |
1202 | 1203 | |
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php |
— | — | @@ -517,7 +517,7 @@ |
518 | 518 | # Otherwise, add a row unless we are just setting it as the site default, |
519 | 519 | # or it is the same the current one... |
520 | 520 | } elseif ( !$reset ) { |
521 | | - $dbExpiry = $dbw->timestamp( $this->expiry ); |
| 521 | + $dbExpiry = Block::encodeExpiry( $this->expiry, $dbw ); |
522 | 522 | if ( !$oldRow // no previous config, or... |
523 | 523 | || $oldRow->fpc_select != $this->select // ...precedence changed, or... |
524 | 524 | || $oldRow->fpc_override != $this->override // ...override changed, or... |