* @return string The URL
*/
public function getLinkURL( $query = '', $query2 = false, $proto = PROTO_RELATIVE ) {
- wfProfileIn( __METHOD__ );
if ( $this->isExternal() || $proto !== PROTO_RELATIVE ) {
$ret = $this->getFullURL( $query, $query2, $proto );
} elseif ( $this->getPrefixedText() === '' && $this->hasFragment() ) {
} else {
$ret = $this->getLocalURL( $query, $query2 ) . $this->getFragmentForURL();
}
- wfProfileOut( __METHOD__ );
return $ret;
}
protected function getUserPermissionsErrorsInternal( $action, $user,
$doExpensiveQueries = true, $short = false
) {
- wfProfileIn( __METHOD__ );
# Read has special handling
if ( $action == 'read' ) {
$errors = $this->$method( $action, $user, $errors, $doExpensiveQueries, $short );
}
- wfProfileOut( __METHOD__ );
return $errors;
}
return array( $this->mHasCascadingRestrictions, $pagerestrictions );
}
- wfProfileIn( __METHOD__ );
-
$dbr = wfGetDB( DB_SLAVE );
if ( $this->getNamespace() == NS_FILE ) {
$this->mHasCascadingRestrictions = $sources;
}
- wfProfileOut( __METHOD__ );
return array( $sources, $pagerestrictions );
}
if ( $this->mIsBigDeletion === null ) {
$dbr = wfGetDB( DB_SLAVE );
- $innerQuery = $dbr->selectSQLText(
+ $revCount = $dbr->selectRowCount(
'revision',
'1',
array( 'rev_page' => $this->getArticleID() ),
array( 'LIMIT' => $wgDeleteRevisionsLimit + 1 )
);
- $revCount = $dbr->query(
- 'SELECT COUNT(*) FROM (' . $innerQuery . ') AS innerQuery',
- __METHOD__
- );
- $revCount = $revCount->fetchRow();
- $revCount = $revCount['COUNT(*)'];
-
$this->mIsBigDeletion = $revCount > $wgDeleteRevisionsLimit;
}
*/
public function getPageLanguage() {
global $wgLang, $wgLanguageCode;
- wfProfileIn( __METHOD__ );
if ( $this->isSpecialPage() ) {
// special pages are in the user language
- wfProfileOut( __METHOD__ );
return $wgLang;
}
// Checking if DB language is set
if ( $this->mDbPageLanguage ) {
- wfProfileOut( __METHOD__ );
return wfGetLangObj( $this->mDbPageLanguage );
}
$langObj = wfGetLangObj( $this->mPageLanguage[0] );
}
- wfProfileOut( __METHOD__ );
return $langObj;
}
$editnotice_ns = 'editnotice-' . $this->getNamespace();
$editnotice_ns_message = wfMessage( $editnotice_ns );
if ( $editnotice_ns_message->exists() ) {
- $notices[$editnotice_ns] = $editnotice_ns_message->parseAsBlock();
+ $notices[$editnotice_ns] = '<div class="mw-editnotice mw-editnotice-namespace ' .
+ Sanitizer::escapeClass( "mw-$editnotice_ns" ) . '">' .
+ $editnotice_ns_message->parseAsBlock() . '</div>';
}
if ( MWNamespace::hasSubpages( $this->getNamespace() ) ) {
$parts = explode( '/', $this->getDBkey() );
$editnotice_base .= '-' . array_shift( $parts );
$editnotice_base_msg = wfMessage( $editnotice_base );
if ( $editnotice_base_msg->exists() ) {
- $notices[$editnotice_base] = $editnotice_base_msg->parseAsBlock();
+ $notices[$editnotice_base] = '<div class="mw-editnotice mw-editnotice-base ' .
+ Sanitizer::escapeClass( "mw-$editnotice_base" ) . '">' .
+ $editnotice_base_msg->parseAsBlock() . '</div>';
}
}
} else {
$editnoticeText = $editnotice_ns . '-' . str_replace( '/', '-', $this->getDBkey() );
$editnoticeMsg = wfMessage( $editnoticeText );
if ( $editnoticeMsg->exists() ) {
- $notices[$editnoticeText] = $editnoticeMsg->parseAsBlock();
+ $notices[$editnoticeText] = '<div class="mw-editnotice mw-editnotice-page ' .
+ Sanitizer::escapeClass( "mw-$editnoticeText" ) . '">' .
+ $editnoticeMsg->parseAsBlock() . '</div>';
}
}