Fix for ProtectionForm - consider expiry times invalid if theyre in the past. Also...
authorAndrew Garrett <werdna@users.mediawiki.org>
Fri, 16 Feb 2007 07:39:33 +0000 (07:39 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Fri, 16 Feb 2007 07:39:33 +0000 (07:39 +0000)
includes/ProtectionForm.php
languages/messages/MessagesEn.php

index 0b96521..d1bbae0 100644 (file)
@@ -158,6 +158,12 @@ class ProtectionForm {
                        }
 
                        $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 );
@@ -292,7 +298,7 @@ class ProtectionForm {
                                '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,
index e03cc60..683f1e5 100644 (file)
@@ -1760,6 +1760,7 @@ Please hit "back" and reload the page you came from, then try again.',
 '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',