From: Niklas Laxström Date: Thu, 18 Jan 2007 00:52:15 +0000 (+0000) Subject: * Escaping and Xml X-Git-Tag: 1.31.0-rc.0~54318 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=79fce690f7e4370f17f65bd771acff01c3377da6;p=lhc%2Fweb%2Fwiklou.git * Escaping and Xml --- diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index fe1a7af728..3dcdbd09f8 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -62,15 +62,14 @@ class IPBlockForm { $wgOut->addWikiText( wfMsg( 'blockiptext' ) ); if($wgSysopUserBans) { - $mIpaddress = wfMsgHtml( 'ipadressorusername' ); + $mIpaddress = Xml::label( wfMsg( 'ipadressorusername' ), 'mw-bi-target' ); } else { - $mIpaddress = wfMsgHtml( 'ipaddress' ); + $mIpaddress = Xml::label( wfMsg( 'ipadress' ), 'mw-bi-target' ); } - $mIpbexpiry = wfMsgHtml( 'ipbexpiry' ); - $mIpbother = wfMsgHtml( 'ipbother' ); + $mIpbexpiry = Xml::label( wfMsg( 'ipbexpiry' ), 'wpBlockExpiry' ); + $mIpbother = Xml::label( wfMsg( 'ipbother' ), 'mw-bi-other' ); $mIpbothertime = wfMsgHtml( 'ipbotheroption' ); - $mIpbreason = wfMsgHtml( 'ipbreason' ); - $mIpbsubmit = wfMsgHtml( 'ipbsubmit' ); + $mIpbreason = Xml::label( wfMsg( 'ipbreason' ), 'mw-bi-reason' ); $titleObj = SpecialPage::getTitleFor( 'Blockip' ); $action = $titleObj->escapeLocalURL( "action=submit" ); @@ -79,10 +78,7 @@ class IPBlockForm { $wgOut->addHTML( "

{$err}

\n" ); } - $scBlockAddress = htmlspecialchars( $this->BlockAddress ); - $scBlockReason = htmlspecialchars( $this->BlockReason ); - $scBlockOtherTime = htmlspecialchars( $this->BlockOther ); - $scBlockExpiryOptions = htmlspecialchars( wfMsgForContent( 'ipboptions' ) ); + $scBlockExpiryOptions = wfMsgForContent( 'ipboptions' ); $showblockoptions = $scBlockExpiryOptions != '-'; if (!$showblockoptions) @@ -108,7 +104,8 @@ class IPBlockForm { {$mIpaddress}: - + " . Xml::input( 'wpBlockAddress', 40, $this->BlockAddress, + array( 'tabindex' => '1', 'id' => 'mw-bi-target' ) ) . " "); @@ -127,13 +124,15 @@ class IPBlockForm { {$mIpbother}: - + " . Xml::input( 'wpBlockOther', 40, $this->BlockOther, + array( 'tabindex' => '3', 'id' => 'mw-bi-other' ) ) . " {$mIpbreason}: - + " . Xml::input( 'wpBlockReason', 40, $this->BlockReason, + array( 'tabindex' => '3', 'id' => 'mw-bi-reason' ) ) . " @@ -152,23 +151,24 @@ class IPBlockForm { array( 'tabindex' => 5 ) ) . " - -   - - " . wfCheckLabel( wfMsg( 'ipbenableautoblock' ), - 'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock, - array( 'tabindex' => 6 ) ) . " - - + +   + + " . wfCheckLabel( wfMsg( 'ipbenableautoblock' ), + 'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock, + array( 'tabindex' => 6 ) ) . " + +   - + " . Xml::submitButton( wfMsg( 'ipbsubmit' ), + array( 'name' => 'wpBlock', 'tabindex' => '7' ) ) . " - - -\n" ); + " . + Xml::hidden( 'wpEditToken', $token ) . +"\n" ); $wgOut->addHtml( $this->getConvenienceLinks() ); diff --git a/includes/SpecialMIMEsearch.php b/includes/SpecialMIMEsearch.php index 8678118f2a..fb2740321d 100644 --- a/includes/SpecialMIMEsearch.php +++ b/includes/SpecialMIMEsearch.php @@ -69,7 +69,7 @@ class MIMEsearchPage extends QueryPage { $download = $skin->makeMediaLink( $nt->getText(), 'fuck me!', wfMsgHtml( 'download' ) ); $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'), $wgLang->formatNum( $result->img_size ) ); - $dimensions = wfMsg( 'widthheight', $wgLang->formatNum( $result->img_width ), + $dimensions = wfMsgHtml( 'widthheight', $wgLang->formatNum( $result->img_width ), $wgLang->formatNum( $result->img_height ) ); $user = $skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text ); $time = $wgLang->timeanddate( $result->img_timestamp ); diff --git a/includes/SpecialNewimages.php b/includes/SpecialNewimages.php index 062e7e12ee..47318ccbfc 100644 --- a/includes/SpecialNewimages.php +++ b/includes/SpecialNewimages.php @@ -161,9 +161,9 @@ function wfSpecialNewimages( $par, $specialPage ) { if ($shownav) { $wgOut->addHTML( "
" . - " " . - "
" ); + Xml::input( 'wpIlMatch', 20, $wpIlMatch ) . ' ' . + Xml::submitButton( $sub, array( 'name' => 'wpIlSubmit' ) ) . + "" ); } /** @@ -178,21 +178,21 @@ function wfSpecialNewimages( $par, $specialPage ) { } $now = wfTimestampNow(); $date = $wgLang->timeanddate( $now, true ); - $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsg( 'sp-newimages-showfrom', $date ), 'from='.$now.$botpar.$searchpar ); + $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml( 'sp-newimages-showfrom', $date ), 'from='.$now.$botpar.$searchpar ); - $botLink = $sk->makeKnownLinkObj($titleObj, wfMsg( 'showhidebots', ($hidebots ? wfMsg('show') : wfMsg('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar); + $botLink = $sk->makeKnownLinkObj($titleObj, wfMsgHtml( 'showhidebots', ($hidebots ? wfMsgHtml('show') : wfMsgHtml('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar); - $prevLink = wfMsg( 'prevn', $wgLang->formatNum( $limit ) ); + $prevLink = wfMsgHtml( 'prevn', $wgLang->formatNum( $limit ) ); if( $firstTimestamp && $firstTimestamp != $latestTimestamp ) { $prevLink = $sk->makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar ); } - $nextLink = wfMsg( 'nextn', $wgLang->formatNum( $limit ) ); + $nextLink = wfMsgHtml( 'nextn', $wgLang->formatNum( $limit ) ); if( $shownImages > $limit && $lastTimestamp ) { $nextLink = $sk->makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar ); } - $prevnext = '

' . $botLink . ' '. wfMsg( 'viewprevnext', $prevLink, $nextLink, $dateLink ) .'

'; + $prevnext = '

' . $botLink . ' '. wfMsgHtml( 'viewprevnext', $prevLink, $nextLink, $dateLink ) .'

'; if ($shownav) $wgOut->addHTML( $prevnext ); diff --git a/includes/SpecialNewpages.php b/includes/SpecialNewpages.php index 6200738357..428dbc59dd 100644 --- a/includes/SpecialNewpages.php +++ b/includes/SpecialNewpages.php @@ -133,13 +133,13 @@ class NewPagesPage extends QueryPage { */ function getPageHeader() { $self = SpecialPage::getTitleFor( $this->getName() ); - $form = wfOpenElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) ); - $form .= ''; - $form .= ''; - $form .= ''; - $form .= ''; - $form .= '
' . wfMsgHtml( 'namespace' ) . '' . HtmlNamespaceSelector( $this->namespace ) . '
' . wfMsgHtml( 'newpages-username' ) . '' . wfInput( 'username', 30, $this->username ) . '
' . wfSubmitButton( wfMsg( 'allpagessubmit' ) ) . '
'; - $form .= wfHidden( 'offset', $this->offset ) . wfHidden( 'limit', $this->limit ) . ''; + $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) ); + $form .= ''; + $form .= ''; + $form .= ''; + $form .= ''; + $form .= '
' . Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '' . Xml::namespaceSelector( $this->namespace ) . '
' . Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) . '' . Xml::input( 'username', 30, $this->username, array( 'id' => 'mw-np-username' ) ) . '
' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '
'; + $form .= Xml::hidden( 'offset', $this->offset ) . Xml::hidden( 'limit', $this->limit ) . ''; return $form; }