From 370e83bb0dfd0c70de268c93bf07ad5ee0897192 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 15 Aug 2008 01:29:47 +0200 Subject: Update auf 1.13.0 --- includes/AjaxFunctions.php | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'includes/AjaxFunctions.php') diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php index ffd3168a..9daca9e5 100644 --- a/includes/AjaxFunctions.php +++ b/includes/AjaxFunctions.php @@ -1,8 +1,7 @@ getSkin(); $output = ''; @@ -84,7 +83,7 @@ function wfSajaxSearch( $term ) { $term = trim( $term ); $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) ); if ( $wgCapitalLinks ) - $term = $wgContLang->ucfirst( $term ); + $term = $wgContLang->ucfirst( $term ); $term_title = Title::newFromText( $term ); $memckey = $term_title ? wfMemcKey( 'ajaxsearch', md5( $term_title->getFullText() ) ) : wfMemcKey( 'ajaxsearch', md5( $term ) ); @@ -97,12 +96,12 @@ function wfSajaxSearch( $term ) { $r = $more = ''; $canSearch = true; - + $results = PrefixSearch::titleSearch( $term, $limit + 1 ); foreach( array_slice( $results, 0, $limit ) as $titleText ) { $r .= '
  • ' . $sk->makeKnownLink( $titleText ) . "
  • \n"; } - + // Hack to check for specials if( $results ) { $t = Title::newFromText( $results[0] ); @@ -128,9 +127,10 @@ function wfSajaxSearch( $term ) { $valid = (bool) $term_title; $term_url = urlencode( $term ); - $term_diplay = htmlspecialchars( $valid ? $term_title->getFullText() : $term ); + $term_normalized = $valid ? $term_title->getFullText() : $term; + $term_display = htmlspecialchars( $term ); $subtitlemsg = ( $valid ? 'searchsubtitle' : 'searchsubtitleinvalid' ); - $subtitle = wfMsgWikiHtml( $subtitlemsg, $term_diplay ); + $subtitle = wfMsgExt( $subtitlemsg, array( 'parse' ), wfEscapeWikiText( $term_normalized ) ); $html = '
    ' . wfMsgHtml( 'hideresults' ) . '
    ' . '

    '.wfMsgHtml('search') @@ -138,15 +138,15 @@ function wfSajaxSearch( $term ) { if( $canSearch ) { $html .= '"; } if( $r ) { - $html .= "

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

    " + $html .= "

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

    " . '' . $more; } @@ -161,7 +161,7 @@ function wfSajaxSearch( $term ) { * Called for AJAX watch/unwatch requests. * @param $pagename Prefixed title string for page to watch/unwatch * @param $watch String 'w' to watch, 'u' to unwatch - * @return String '' or '' on successful watch or unwatch, + * @return String '' or '' on successful watch or unwatch, * respectively, followed by an HTML message to display in the alert box; or * '' on error */ @@ -169,7 +169,7 @@ function wfAjaxWatch($pagename = "", $watch = "") { if(wfReadOnly()) { // redirect to action=(un)watch, which will display the database lock // message - return ''; + return ''; } if('w' !== $watch && 'u' !== $watch) { @@ -206,4 +206,3 @@ function wfAjaxWatch($pagename = "", $watch = "") { return ''.wfMsgExt( 'removedwatchtext', array( 'parse' ), $title->getPrefixedText() ); } } - -- cgit v1.2.3-54-g00ecf