return ( $sources > 0 );
}
+ /**
+ * Determines whether cascading protection sources have already been loaded from
+ * the database.
+ *
+ * @param bool $getPages True to check if the pages are loaded, or false to check
+ * if the status is loaded.
+ * @return bool Whether or not the specified information has been loaded
+ * @since 1.23
+ */
+ public function areCascadeProtectionSourcesLoaded( $getPages = true ) {
+ return $getPages ? isset( $this->mCascadeSources ) : isset( $this->mHasCascadingRestrictions );
+ }
+
/**
* Cascading protection: Get the source of any cascading restrictions on this page.
*
return array( $sources, $pagerestrictions );
}
+ /**
+ * Accessor for mRestrictionsLoaded
+ *
+ * @return bool Whether or not the page's restrictions have already been
+ * loaded from the database
+ * @since 1.23
+ */
+ public function areRestrictionsLoaded() {
+ return $this->mRestrictionsLoaded;
+ }
+
/**
* Accessor/initialisation for mRestrictions
*
: array();
}
+ /**
+ * Accessor/initialisation for mRestrictions
+ *
+ * @return Array of Arrays of Strings the first level indexed by
+ * action, the second level containing the names of the groups
+ * allowed to perform each action
+ * @since 1.23
+ */
+ public function getAllRestrictions() {
+ if ( !$this->mRestrictionsLoaded ) {
+ $this->loadRestrictions();
+ }
+ return $this->mRestrictions;
+ }
+
/**
* Get the expiry time for the restriction against a given action
*
if ( $moveOverRedirect ) {
$newid = $nt->getArticleID();
+ $newcontent = $newpage->getContent();
# Delete the old redirect. We don't save it to history since
# by definition if we've got here it's rather uninteresting.
# a conflict on the unique namespace+title index...
$dbw->delete( 'page', array( 'page_id' => $newid ), __METHOD__ );
- $newpage->doDeleteUpdates( $newid );
+ $newpage->doDeleteUpdates( $newid, $newcontent );
}
# Save a null revision in the page's history notifying of the move