*/
public static function newFromID( $id ) {
$t = Title::newFromID( $id );
- return $t == null ? null : new Article( $t );
+ # FIXME: doesn't inherit right
+ return $t == null ? null : new self( $t );
+ #return $t == null ? null : new static( $t ); // PHP 5.3
}
/**
* @return bool true on success
*/
public function updateRestrictions( $limit = array(), $reason = '', &$cascade = 0, $expiry = array() ) {
- global $wgUser, $wgRestrictionTypes, $wgContLang;
+ global $wgUser, $wgContLang;
+
+ $restrictionTypes = $this->mTitle->getRestrictionTypes();
$id = $this->mTitle->getArticleID();
if ( $id <= 0 ) {
$current = array();
$updated = Article::flattenRestrictions( $limit );
$changed = false;
- foreach( $wgRestrictionTypes as $action ) {
+ foreach( $restrictionTypes as $action ) {
if( isset( $expiry[$action] ) ) {
# Get current restrictions on $action
$aLimits = $this->mTitle->getRestrictions( $action );
$cdel = '';
// User can delete revisions or view deleted revisions...
- $canHide = $wgUser->isAllowed('deleterevision');
+ $canHide = $wgUser->isAllowed( 'deleterevision' );
if( $canHide || ($revision->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) {
- // Is this hidden from Sysops?
if( !$revision->userCan( Revision::DELETED_RESTRICTED ) ) {
- $cdel = $sk->revDeleteLinkDisabled( $canHide );
+ $cdel = $sk->revDeleteLinkDisabled( $canHide ); // rev was hidden from Sysops
} else {
$query = array(
'type' => 'revision',
- 'target' => urlencode( $this->mTitle->getPrefixedDbkey() ),
- 'ids' => urlencode( $oldid )
+ 'target' => $this->mTitle->getPrefixedDbkey(),
+ 'ids' => $oldid
);
$cdel = $sk->revDeleteLink( $query, $revision->isDeleted(File::DELETED_RESTRICTED), $canHide );
}