$this->mCascade = $wgRequest->getBool( 'mwProtect-cascade', $this->mCascade );
foreach( $this->mApplicableTypes as $action ) {
- // Fixme: this form currently requires individual selections,
+ // @todo FIXME: This form currently requires individual selections,
// but the db allows multiples separated by commas.
// Pull the actual restriction from the DB
/**
* Get the expiry time for a given action, by combining the relevant inputs.
*
- * @return 14-char timestamp or "infinity", or false if the input was invalid
+ * @param $action string
+ *
+ * @return string 14-char timestamp or "infinity", or false if the input was invalid
*/
function getExpiry( $action ) {
if ( $this->mExpirySelection[$action] == 'existing' ) {
return false;
}
- // Fixme: non-qualified absolute times are not in users specified timezone
+ // @todo FIXME: Non-qualified absolute times are not in users specified timezone
// and there isn't notice about it in the ui
$time = wfTimestamp( TS_MW, $unix );
}
return false;
}
- if( $wgRequest->getCheck( 'mwProtectWatch' ) && $wgUser->isLoggedIn() ) {
- Action::factory( 'watch', $this->mArticle )->execute();
- } elseif( $this->mTitle->userIsWatching() ) {
- Action::factory( 'unwatch', $this->mArticle )->execute();
+ if ( $wgRequest->getCheck( 'mwProtectWatch' ) && $wgUser->isLoggedIn() ) {
+ WatchAction::doWatch( $this->mTitle, $wgUser );
+ } elseif ( $this->mTitle->userIsWatching() ) {
+ WatchAction::doUnwatch( $this->mTitle, $wgUser );
}
return $ok;
}
</td>
<td class='mw-input'>" .
Xml::input( 'mwProtect-reason', 60, $this->mReason, array( 'type' => 'text',
- 'id' => 'mwProtect-reason', 'maxlength' => 255 ) ) .
+ 'id' => 'mwProtect-reason', 'maxlength' => 180 ) ) .
+ // Limited maxlength as the database trims at 255 bytes and other texts
+ // chosen by dropdown menus on this page are also included in this database field.
+ // The byte limit of 180 bytes is enforced in javascript
"</td>
</tr>";
# Disallow watching is user is not logged in