/** @var array Array of groups allowed to edit this article */
public $mRestrictions = [];
- /** @var string|bool */
+ /**
+ * @var string|bool Comma-separated set of permission keys
+ * indicating who can move or edit the page from the page table, (pre 1.10) rows.
+ * Edit and move sections are separated by a colon
+ * Example: "edit=autoconfirmed,sysop:move=sysop"
+ */
protected $mOldRestrictions = false;
/** @var bool Cascade restrictions on this page to included templates and images? */
public function getFragmentForURL() {
if ( !$this->hasFragment() ) {
return '';
- } elseif ( $this->isExternal() && !$this->getTransWikiID() ) {
+ } elseif ( $this->isExternal()
+ && !self::getInterwikiLookup()->fetch( $this->mInterwiki )->isLocal()
+ ) {
return '#' . Sanitizer::escapeIdForExternalInterwiki( $this->getFragment() );
}
return '#' . Sanitizer::escapeIdForLink( $this->getFragment() );
* @see wfExpandUrl
* @param string|string[] $query
* @param string|string[]|bool $query2
- * @param string $proto Protocol type to use in URL
+ * @param string|int|null $proto Protocol type to use in URL
* @return string The URL
*/
public function getFullURL( $query = '', $query2 = false, $proto = PROTO_RELATIVE ) {
if ( $this->isExternal() ) {
$target = SpecialPage::getTitleFor(
'GoToInterwiki',
- $this->getPrefixedDBKey()
+ $this->getPrefixedDBkey()
);
}
- return $target->getFullUrl( $query, false, $proto );
+ return $target->getFullURL( $query, false, $proto );
}
/**
* Public for usage by LiquidThreads.
*
* @param array $rows Array of db result objects
- * @param string $oldFashionedRestrictions Comma-separated list of page
- * restrictions from page table (pre 1.10)
+ * @param string $oldFashionedRestrictions Comma-separated set of permission keys
+ * indicating who can move or edit the page from the page table, (pre 1.10) rows.
+ * Edit and move sections are separated by a colon
+ * Example: "edit=autoconfirmed,sysop:move=sysop"
*/
public function loadRestrictionsFromRows( $rows, $oldFashionedRestrictions = null ) {
$dbr = wfGetDB( DB_REPLICA );
/**
* Load restrictions from the page_restrictions table
*
- * @param string $oldFashionedRestrictions Comma-separated list of page
- * restrictions from page table (pre 1.10)
+ * @param string $oldFashionedRestrictions Comma-separated set of permission keys
+ * indicating who can move or edit the page from the page table, (pre 1.10) rows.
+ * Edit and move sections are separated by a colon
+ * Example: "edit=autoconfirmed,sysop:move=sysop"
*/
public function loadRestrictions( $oldFashionedRestrictions = null ) {
if ( $this->mRestrictionsLoaded ) {
* on the number of links. Typically called on create and delete.
*/
public function touchLinks() {
- DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'pagelinks' ) );
+ DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'pagelinks', 'page-touch' ) );
if ( $this->getNamespace() == NS_CATEGORY ) {
- DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'categorylinks' ) );
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $this, 'categorylinks', 'category-touch' )
+ );
}
}
/**
* Get the last touched timestamp
*
- * @param IDatabase $db Optional db
+ * @param IDatabase|null $db
* @return string|false Last-touched timestamp
*/
public function getTouched( $db = null ) {