$ip = User::isIP( $username );
if ( !$user->isLoggedIn() && !$ip ) { # User does not exist
$wgOut->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n$1\n</div>",
- array( 'userpage-userdoesnotexist', $username ) );
+ array( 'userpage-userdoesnotexist', wfEscapeWikiText( $username ) ) );
} elseif ( $user->isBlocked() ) { # Show log extract if the user is currently blocked
LogEventsList::showLogExtract(
$wgOut,
'style' => '' // avoid php notices when appending preferences (appending allows customAttribs['style'] to still work
);
- global $wgBetterDirectionality, $wgContLang;
+ global $wgBetterDirectionality;
if( $wgBetterDirectionality ) {
$pageLang = $this->mTitle->getPageLanguage();
$attribs['lang'] = $pageLang->getCode();
if ( $wgRawHtml && !$this->mTokenOk ) {
// Could be an offsite preview attempt. This is very unsafe if
// HTML is enabled, as it could be an attack.
- $parsedNote = $wgOut->parse( "<div class='previewnote'>" .
- wfMsg( 'session_fail_preview_html' ) . "</div>" );
+ $parsedNote = '';
+ if ( $this->textbox1 !== '' ) {
+ // Do not put big scary notice, if previewing the empty
+ // string, which happens when you initially edit
+ // a category page, due to automatic preview-on-open.
+ $parsedNote = $wgOut->parse( "<div class='previewnote'>" .
+ wfMsg( 'session_fail_preview_html' ) . "</div>" );
+ }
wfProfileOut( __METHOD__ );
return $parsedNote;
}
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
$parserOptions->setTargetLanguage( $this->mTitle->getPageLanguage() );
}
- $parserOptions->setTargetLanguage( $this->mTitle->getPageLanguage() );
$parserOptions->setTidy( true );
$parserOptions->enableLimitReport();
$parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ),
global $wgBetterDirectionality;
if( $wgBetterDirectionality ) {
$pageLang = $this->mTitle->getPageLanguage();
- $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() );
+ $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
+ 'class' => 'mw-content-'.$pageLang->getDir() );
$previewHTML = Html::rawElement( 'div', $attribs, $previewHTML );
}
wfProfileOut( __METHOD__ );