autolinked correctly
* (bug 17224) Added siprop=rightsinfo to meta=siteinfo
* (bug 17239) Added prop=displaytitle to action=parse
+* (bug 17317) Added watch parameter to action=protect
=== Languages updated in 1.15 ===
}
$cascade = $params['cascade'];
- if($titleObj->exists()) {
- $articleObj = new Article($titleObj);
+ $articleObj = new Article($titleObj);
+ if($params['watch'])
+ $articleObj->doWatch();
+ if($titleObj->exists())
$ok = $articleObj->updateRestrictions($protections, $params['reason'], $cascade, $expiryarray);
- } else
+ else
$ok = $titleObj->updateTitleProtection($protections['create'], $params['reason'], $expiryarray['create']);
if(!$ok)
// This is very weird. Maybe the article was deleted or the user was blocked/desysopped in the meantime?
ApiBase :: PARAM_DFLT => 'infinite',
),
'reason' => '',
- 'cascade' => false
+ 'cascade' => false,
+ 'watch' => false,
);
}
'reason' => 'Reason for (un)protecting (optional)',
'cascade' => array('Enable cascading protection (i.e. protect pages included in this page)',
'Ignored if not all protection levels are \'sysop\' or \'protect\''),
+ 'watch' => 'If set, add the page being (un)protected to your watchlist',
);
}