From: Victor Vasiliev Date: Sun, 16 Dec 2007 10:06:42 +0000 (+0000) Subject: Fix output of wfSajaxSearch: X-Git-Tag: 1.31.0-rc.0~50403 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=58d8a1bf6140c3b662d36550e70bc97a0546b5aa;p=lhc%2Fweb%2Fwiklou.git Fix output of wfSajaxSearch: * Escape all messages * Use pretty output for terms instead of urlencoded one --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a2468f44a9..ba28b9f187 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -361,6 +361,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API now 500 / 5000, in line with other modules. * Added list=allcategories module * (bug 12321) API list=blocks reveals private data +* Fix output of wfSajaxSearch === Languages updated in 1.12 === diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php index 4fb76dccda..e16f6cc49e 100644 --- a/includes/AjaxFunctions.php +++ b/includes/AjaxFunctions.php @@ -79,6 +79,7 @@ function wfSajaxSearch( $term ) { $l = new Linker; + $term = trim( $term ); $term = str_replace( ' ', '_', $wgContLang->ucfirst( $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) ) ) ); @@ -113,18 +114,19 @@ function wfSajaxSearch( $term ) { $subtitlemsg = ( Title::newFromText($term) ? 'searchsubtitle' : 'searchsubtitleinvalid' ); $subtitle = $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) ); #FIXME: parser is missing mTitle ! - $term = urlencode( $term ); + $term_url = urlencode( $term ); + $term_diplay = htmlspecialchars( str_replace( '_', ' ', $term ) ); $html = '
' - . wfMsg( 'hideresults' ) . '
' - . '

'.wfMsg('search') + . wfMsgHtml( 'hideresults' ) . '' + . '

'.wfMsgHtml('search') . '

'. $subtitle . '

" . wfMsg( 'articletitles', $term ) . "

" + wfMsgHtml( 'searchnamed', $term_diplay ) , + "search={$term_url}&go=Go" ) + . "

" . wfMsgHtml( 'articletitles', $term_diplay ) . "

" . ''.$more; $response = new AjaxResponse( $html );