Changeset 28088


Ignore:
Timestamp:
04/05/14 21:30:23 (5 years ago)
Author:
rvelices
Message:

small autocomplete fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_autocomplete/functions.inc.php

    r27564 r28088  
    3535 
    3636 
    37 function rvac_normalize($q) 
    38 { 
    39   $q = str_replace('&', ' ', $q); 
    40   $q = str_replace('.', ' ', $q); 
    41   $q = str_replace(',', ' ', $q); 
    42   $q = str_replace('-', ' ', $q); 
    43   $q = transliterate($q); 
     37function rvac_normalize($name) 
     38{ 
     39  $invalid = '&().,-'; 
     40  $name = strtr($name, $invalid, str_repeat(' ', strlen($invalid))); 
     41  $name = transliterate($name); 
    4442  for($i=0; $i<3; $i++) 
    45     $q = str_replace('  ', ' ', $q); 
    46   return $q; 
     43    $name = str_replace('  ', ' ', $name); 
     44  return $name; 
    4745} 
    4846 
     
    5856    $ret['q'] = $q; 
    5957        if ($item['counter'] > 0) 
    60                 $ret['w'] = $item['counter']; 
     58                $ret['w'] = intval($item['counter']); 
    6159  return $ret; 
    6260} 
Note: See TracChangeset for help on using the changeset viewer.