From: Ilmari Karonen Date: Sun, 2 Jul 2006 22:50:52 +0000 (+0000) Subject: "searchsubtitleinvalid" message for searches that are not valid titles X-Git-Tag: 1.31.0-rc.0~56454 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=50359b0f48a1787993007d0e7cbf8e4c7937c274;p=lhc%2Fweb%2Fwiklou.git "searchsubtitleinvalid" message for searches that are not valid titles --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a0ae8d912a..0bbdc2b9b4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -633,6 +633,7 @@ Some default configuration options have changed: * Introduce updateArticleCount maintenance script which uses a better check that reflects what Article::isCountable() tests for * Introduce 'BadImage' hook; see docs/hooks.txt for more information +* Add "searchsubtitleinvalid" message for searches that are not valid titles. == Compatibility == diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php index 28b01eec2c..7ee4a3ef43 100644 --- a/includes/AjaxFunctions.php +++ b/includes/AjaxFunctions.php @@ -136,11 +136,14 @@ function wfSajaxSearch( $term ) { $more = ''; } + $subtitlemsg = ( Title::newFromtext($term) ? 'searchsubtitle' : 'searchsubtitleinvalid' ); + $subtitle = $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) ); + $term = htmlspecialchars( $term ); return '
' . wfMsg( 'hideresults' ) . '
' . '

'.wfMsg('search') - . '

'. $wgOut->parse( wfMsg( 'searchsubtitle', $term ) ) . '