}
$expiry = wfTimestamp( TS_MW, $expiry );
+
+ if ( $expiry < wfTimestampNow() ) {
+ $this->show( wfMsg( 'protect_expiry_old' ) );
+ return false;
+ }
+
}
$ok = $this->mArticle->updateRestrictions( $this->mRestrictions, $this->mReason, $this->mCascade, $expiry );
'id' => "$id-label",
'for' => $id ),
wfMsg( 'protectexpiry' ) );
- $ci .= "</td> <td aligh=\"left\">";
+ $ci .= "</td> <td align=\"left\">";
$ci .= wfElement( 'input', array(
'size' => 60,
'name' => $id,
'protectcomment' => 'Reason for protecting',
'protectexpiry' => 'Expiry',
'protect_expiry_invalid' => 'Expiry time is invalid.',
+'protect_expiry_old' => 'Expiry time is in the past.',
'unprotectsub' =>"(Unprotecting \"$1\")",
'confirmunprotecttext' => 'Do you really want to unprotect this page?',
'confirmunprotect' => 'Confirm unprotection',