if ( empty($name) )
$name = wfMsg( 'blanknamespace' );
+ $name = htmlspecialchars( $name );
+
$r1 .= "<input type='checkbox' value='1' name='wpNs$i' id='wpNs$i' {$checked}/> <label for='wpNs$i'>{$name}</label><br />\n";
}
return $r1;
function getToggle( $tname, $trailer = false, $disabled = false ) {
- global $wgUser, $wgLang;
+ global $wgUser, $wgLang, $wgOut;
$this->mUsedToggles[$tname] = true;
- $ttext = $wgLang->getUserToggle( $tname );
+ if ( $tname !== 'highlightbroken' ) {
+ $ttext = $wgOut->parse( $wgLang->getUserToggle( $tname ), false, true );
+ if( preg_match( "~^<p>(.*)\n?</p>$~", $ttext, $m = array() ) ) {
+ $ttext = $m[1];
+ }
+ } else {
+ $ttext = $wgLang->getUserToggle( $tname );
+ }
$checked = $wgUser->getOption( $tname ) == 1 ? ' checked="checked"' : '';
$disabled = $disabled ? ' disabled="disabled"' : '';
if ($wgEmailAuthentication && ($this->mUserEmail != '') ) {
if( $wgUser->getEmailAuthenticationTimestamp() ) {
- $emailauthenticated = wfMsg('emailauthenticated',$wgLang->timeanddate($wgUser->getEmailAuthenticationTimestamp(), true ) ).'<br />';
+ $emailauthenticated = htmlspecialchars( wfMsg( 'emailauthenticated',
+ $wgLang->timeanddate( $wgUser->getEmailAuthenticationTimestamp(), true )
+ ) ) .'<br />';
$disableEmailPrefs = false;
} else {
$disableEmailPrefs = true;
$skin = $wgUser->getSkin();
- $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' .
+ $emailauthenticated = wfMsgHtml( 'emailnotauthenticated' ) . '<br />' .
$skin->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Confirmemail' ),
wfMsg( 'emailconfirmlink' ) );
}
# User data
#
- $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg('prefs-personal') . "</legend>\n<table>\n");
+ $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsgHtml('prefs-personal') . "</legend>\n<table>\n");
$wgOut->addHTML(
$this->addRow(
- wfMsg( 'username'),
+ wfMsgHtml( 'username'),
$wgUser->getName()
)
);
$wgOut->addHTML(
$this->addRow(
- wfMsg( 'uid' ),
+ wfMsgHtml( 'uid' ),
$wgUser->getID()
)
);
if ($wgAllowRealName) {
$wgOut->addHTML(
$this->addRow(
- '<label for="wpRealName">' . wfMsg('yourrealname') . '</label>',
+ '<label for="wpRealName">' . wfMsgHtml('yourrealname') . '</label>',
"<input type='text' name='wpRealName' id='wpRealName' value=\"{$this->mRealName}\" size='25' />"
)
);
if ($wgEnableEmail) {
$wgOut->addHTML(
$this->addRow(
- '<label for="wpUserEmail">' . wfMsg( 'youremail' ) . '</label>',
+ '<label for="wpUserEmail">' . wfMsgHtml( 'youremail' ) . '</label>',
"<input type='text' name='wpUserEmail' id='wpUserEmail' value=\"{$this->mUserEmail}\" size='25' />"
)
);
$wgOut->addHTML(
$this->addRow(
- '<label for="wpNick">' . wfMsg( 'yournick' ) . '</label>',
+ '<label for="wpNick">' . wfMsgHtml( 'yournick' ) . '</label>',
"<input type='text' name='wpNick' id='wpNick' value=\"{$this->mNick}\" size='25' />"
) .
$invalidSig .
* Make sure the site language is in the list; a custom language code
* might not have a defined name...
*/
- $languages = $wgLang->getLanguageNames( true );
+ $languages = $wgLang->getLanguageNames( false );
if( !array_key_exists( $wgContLanguageCode, $languages ) ) {
$languages[$wgContLanguageCode] = $wgContLanguageCode;
}
$selectedLang = isset( $languages[$this->mUserLanguage] ) ? $this->mUserLanguage : $wgContLanguageCode;
$selbox = null;
foreach($languages as $code => $name) {
+ $name = htmlspecialchars( $name );
global $IP;
$sel = ($code == $selectedLang)? ' selected="selected"' : '';
$selbox .= "<option value=\"$code\"$sel>$code - $name</option>\n";
}
$wgOut->addHTML(
$this->addRow(
- '<label for="wpUserLanguage">' . wfMsg('yourlanguage') . '</label>',
+ '<label for="wpUserLanguage">' . wfMsgHtml('yourlanguage') . '</label>',
"<select name='wpUserLanguage' id='wpUserLanguage'>$selbox</select>"
)
);
$this->mNewpass = htmlspecialchars( $this->mNewpass );
$this->mRetypePass = htmlspecialchars( $this->mRetypePass );
- $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'changepassword' ) . '</legend><table>');
+ $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'changepassword' ) . '</legend><table>');
$wgOut->addHTML(
$this->addRow(
- '<label for="wpOldpass">' . wfMsg( 'oldpassword' ) . '</label>',
+ '<label for="wpOldpass">' . wfMsgHtml( 'oldpassword' ) . '</label>',
"<input type='password' name='wpOldpass' id='wpOldpass' value=\"{$this->mOldpass}\" size='20' />"
) .
$this->addRow(
- '<label for="wpNewpass">' . wfMsg( 'newpassword' ) . '</label>',
+ '<label for="wpNewpass">' . wfMsgHtml( 'newpassword' ) . '</label>',
"<input type='password' name='wpNewpass' id='wpNewpass' value=\"{$this->mNewpass}\" size='20' />"
) .
$this->addRow(
- '<label for="wpRetypePass">' . wfMsg( 'retypenew' ) . '</label>',
+ '<label for="wpRetypePass">' . wfMsgHtml( 'retypenew' ) . '</label>',
"<input type='password' name='wpRetypePass' id='wpRetypePass' value=\"{$this->mRetypePass}\" size='20' />"
) .
"</table>\n" .
# <FIXME>
# Enotif
if ($wgEnableEmail) {
- $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'email' ) . '</legend>' );
+ $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'email' ) . '</legend>' );
$wgOut->addHTML(
$emailauthenticated.
$enotifrevealaddr.
$enotifusertalkpages.
$enotifminoredits );
if ($wgEnableUserEmail) {
- $emf = wfMsg( 'allowemail' );
+ $emf = wfMsgHtml( 'allowemail' );
$disabled = $disableEmailPrefs ? ' disabled="disabled"' : '';
$wgOut->addHTML(
"<div><input type='checkbox' $emfc $disabled value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label for='wpEmailFlag'>$emf</label></div>" );
$tips[] = wfMsg( 'prefs-help-realname' );
if( $wgEnableEmail )
$tips[] = wfMsg( 'prefs-help-email' );
- $wgOut->addHtml( '<div class="prefsectiontip">' . implode( '<br />', $tips ) . '</div>' );
+ $wgOut->addWikitext( '<div class="prefsectiontip">' . implode( '<br />', $tips ) . '</div>' );
}
$wgOut->addHTML( '</fieldset>' );
# Quickbar
#
if ($this->mSkin == 'cologneblue' || $this->mSkin == 'standard') {
- $wgOut->addHtml( "<fieldset>\n<legend>" . wfMsg( 'qbsettings' ) . "</legend>\n" );
+ $wgOut->addHtml( "<fieldset>\n<legend>" . wfMsgHtml( 'qbsettings' ) . "</legend>\n" );
for ( $i = 0; $i < count( $qbs ); ++$i ) {
if ( $i == $this->mQuickbar ) { $checked = ' checked="checked"'; }
else { $checked = ""; }
# Skin
#
- $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg('skin') . "</legend>\n" );
+ $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsgHtml('skin') . "</legend>\n" );
$mptitle = Title::newMainPage();
- $previewtext = wfMsg('skinpreview');
+ $previewtext = wfMsgHtml('skinpreview');
# Only show members of Skin::getSkinNames() rather than
# $skinNames (skins is all skin names from Language.php)
$validSkinNames = Skin::getSkinNames();
$mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey"));
$previewlink = "<a target='_blank' href=\"$mplink\">$previewtext</a>";
if( $skinkey == $wgDefaultSkin )
- $sn .= ' (' . wfMsg( 'default' ) . ')';
+ $sn .= ' (' . wfMsgHtml( 'default' ) . ')';
$wgOut->addHTML( "<input type='radio' name='wpSkin' id=\"wpSkin$skinkey\" value=\"$skinkey\"$checked /> <label for=\"wpSkin$skinkey\">{$sn}</label> $previewlink<br />\n" );
}
$wgOut->addHTML( "</fieldset>\n\n" );
#
global $wgUseTeX;
if( $wgUseTeX ) {
- $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg('math') . '</legend>' );
+ $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsgHtml('math') . '</legend>' );
foreach ( $mathopts as $k => $v ) {
$checked = $k == $this->mMath ? ' checked="checked"' : '';
- $wgOut->addHTML( "<div><label><input type='radio' name='wpMath' value=\"$k\"$checked /> ".wfMsg($v)."</label></div>\n" );
+ $wgOut->addHTML( "<div><label><input type='radio' name='wpMath' value=\"$k\"$checked /> ".wfMsgHtml($v)."</label></div>\n" );
}
$wgOut->addHTML( "</fieldset>\n\n" );
}
# Files
#
$wgOut->addHTML("<fieldset>
- <legend>" . wfMsg( 'files' ) . "</legend>
- <div><label for='wpImageSize'>" . wfMsg('imagemaxsize') . "</label> <select id='wpImageSize' name='wpImageSize'>");
+ <legend>" . wfMsgHtml( 'files' ) . "</legend>
+ <div><label for='wpImageSize'>" . wfMsgHtml('imagemaxsize') . "</label> <select id='wpImageSize' name='wpImageSize'>");
$imageLimitOptions = null;
foreach ( $wgImageLimits as $index => $limits ) {
$imageThumbOptions = null;
$wgOut->addHTML( "{$imageLimitOptions}</select></div>
- <div><label for='wpThumbSize'>" . wfMsg('thumbsize') . "</label> <select name='wpThumbSize' id='wpThumbSize'>");
+ <div><label for='wpThumbSize'>" . wfMsgHtml('thumbsize') . "</label> <select name='wpThumbSize' id='wpThumbSize'>");
foreach ( $wgThumbLimits as $index => $size ) {
$selected = ($index == $this->mThumbSize) ? 'selected="selected"' : '';
$imageThumbOptions .= "<option value=\"{$index}\" {$selected}>{$size}". wfMsgHtml('unit-pixel') ."</option>\n";
# Date/Time
#
- $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg( 'datetime' ) . "</legend>\n" );
+ $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsgHtml( 'datetime' ) . "</legend>\n" );
if ($dateopts) {
- $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg( 'dateformat' ) . "</legend>\n" );
+ $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsgHtml( 'dateformat' ) . "</legend>\n" );
$idCnt = 0;
$epoch = '20010115161234'; # Wikipedia day
foreach( $dateopts as $key ) {
$nowlocal = $wgLang->time( $now = wfTimestampNow(), true );
$nowserver = $wgLang->time( $now, false );
- $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'timezonelegend' ). '</legend><table>' .
- $this->addRow( wfMsg( 'servertime' ), $nowserver ) .
- $this->addRow( wfMsg( 'localtime' ), $nowlocal ) .
+ $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'timezonelegend' ). '</legend><table>' .
+ $this->addRow( wfMsgHtml( 'servertime' ), $nowserver ) .
+ $this->addRow( wfMsgHtml( 'localtime' ), $nowlocal ) .
$this->addRow(
- '<label for="wpHourDiff">' . wfMsg( 'timezoneoffset' ) . '</label>',
+ '<label for="wpHourDiff">' . wfMsgHtml( 'timezoneoffset' ) . '</label>',
"<input type='text' name='wpHourDiff' id='wpHourDiff' value=\"" . htmlspecialchars( $this->mHourDiff ) . "\" size='6' />"
) . "<tr><td colspan='2'>
- <input type='button' value=\"" . wfMsg( 'guesstimezone' ) ."\"
+ <input type='button' value=\"" . wfMsgHtml( 'guesstimezone' ) ."\"
onclick='javascript:guessTimezone()' id='guesstimezonebutton' style='display:none;' />
- </td></tr></table><div class='prefsectiontip'>¹" . wfMsg( 'timezonetext' ) . "</div></fieldset>
+ </td></tr></table><div class='prefsectiontip'>¹" . wfMsgHtml( 'timezonetext' ) . "</div></fieldset>
</fieldset>\n\n" );
# Editing
#
global $wgLivePreview, $wgUseRCPatrol;
- $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'textboxsize' ) . '</legend>
+ $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'textboxsize' ) . '</legend>
<div>' .
wfInputLabel( wfMsg( 'rows' ), 'wpRows', 'wpRows', 3, $this->mRows ) .
' ' .
);
$this->mUsedToggles['autopatrol'] = true; # Don't show this up for users who can't; the handler below is dumb and doesn't know it
- $wgOut->addHTML( '<fieldset><legend>' . htmlspecialchars(wfMsg('prefs-rc')) . '</legend>' .
+ $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml('prefs-rc') . '</legend>' .
wfInputLabel( wfMsg( 'recentchangescount' ),
'wpRecent', 'wpRecent', 3, $this->mRecent ) .
$this->getToggles( array(
$wgOut->addHTML( '</fieldset>' );
# Search
- $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'searchresultshead' ) . '</legend><table>' .
+ $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'searchresultshead' ) . '</legend><table>' .
$this->addRow(
wfLabel( wfMsg( 'resultsperpage' ), 'wpSearch' ),
wfInput( 'wpSearch', 4, $this->mSearch, array( 'id' => 'wpSearch' ) )
wfLabel( wfMsg( 'contextchars' ), 'wpSearchChars' ),
wfInput( 'wpSearchChars', 4, $this->mSearchChars, array( 'id' => 'wpSearchChars' ) )
) .
- "</table><fieldset><legend>" . wfMsg( 'defaultns' ) . "</legend>$ps</fieldset></fieldset>" );
+ "</table><fieldset><legend>" . wfMsgHtml( 'defaultns' ) . "</legend>$ps</fieldset></fieldset>" );
# Misc
#
- $wgOut->addHTML('<fieldset><legend>' . wfMsg('prefs-misc') . '</legend>');
+ $wgOut->addHTML('<fieldset><legend>' . wfMsgHtml('prefs-misc') . '</legend>');
$wgOut->addHTML( wfInputLabel( wfMsg( 'stubthreshold' ),
'wpStubs', 'wpStubs', 6, $this->mStubs ) );
$msgUnderline = htmlspecialchars( wfMsg ( 'tog-underline' ) );