Ticket #3625: FCKeditor.Sajax.body.php.2.patch

File FCKeditor.Sajax.body.php.2.patch, 1.2 KB (added by Don Stringham, 11 years ago)

Added logic to handle Lucene 2.1 search.

  • FCKeditorSajax.body.php

     
    198198 * @param String: $term = word to search on.
    199199 * @return String: $results = a \n delimited string contains search results.
    200200 */
    201 function wfSajaxSearchMWSearch($term) {
     201function wfSajaxSearchMWSearch( $term ) {
    202202    global $wgUser, $wgRequest, $wgFCKeditorSearchType;
    203203   
    204204    $search = SearchEngine::create();
     
    219219    $results = "";
    220220    foreach($textMatches->mResults as $row){
    221221        $res = split(" ", $row);
    222         $results .= wfSajaxReplaceSpecialChars($res[2])."\n";
     222        if($res[0][0] != '#') {
     223            $results .= _MWSearchReplaceSpecialChars($res[2])."\n";
     224        }
    223225    }
    224226    return $results;
    225227}
     
    232234 * @param String: $subject = original string to be cleaned-up
    233235 * @return String: $result = cleaned-up string.
    234236 */
    235 function wfSajaxReplaceSpecialChars($subject){
     237function _MWSearchReplaceSpecialChars( $subject ) {
    236238    $result = preg_replace('/_/', ' ', $subject);
    237239    $result = preg_replace('/%../', ' ', $result);
    238240    return $result;
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy