Changeset 28161 for extensions/rv_autocomplete/admin/functions.inc.php
- Timestamp:
- Apr 12, 2014, 8:13:46 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_autocomplete/admin/functions.inc.php
r28153 r28161 22 22 $q = substr($q, 0, $pos); 23 23 } 24 $invalid = '&()".:;,'; 25 $q = strtr($q, $invalid, str_repeat(' ', strlen($invalid))); 26 for($i=0; $i<3; $i++) 27 $q = str_replace(' ', ' ', $q); 24 28 } 25 29 elseif (strncmp($url,'q=',2)==0) … … 35 39 if (isset($q)) 36 40 { 37 if ( ($pos=strpos($q,' ')) !== false )38 {39 $q = '"'.$q.'"';40 }41 41 $url = get_root_url().'qsearch.php?q='.rawurlencode($q); 42 42 } … … 198 198 $results = $rule['out']; 199 199 $processed = array(); 200 if ('a' == $rule['type']) 201 $processed[$in_word_t] = 1; 202 200 203 for ($i=0; $i<count($results); $i++) 201 204 { … … 247 250 file_put_contents($file, $save); 248 251 } 249 @file_put_contents($file.'.txt', var_export($res,true) ); 252 $file=PHPWG_ROOT_PATH.$conf['data_location'].'tmp/autocomplete_variants.txt'; 253 if ($fh = @fopen($file, 'w')) 254 { 255 fputcsv($fh, array("Type", "In", "Out"), "\t"); 256 foreach($rmap as $in => $words) 257 fputcsv($fh, array("r", $in, implode(',', $words)), "\t"); 258 foreach($amap as $in => $words) 259 fputcsv($fh, array("r", $in, implode(',', $words)), "\t"); 260 fclose($fh); 261 } 250 262 } 251 263 … … 282 294 sort($in_trans); 283 295 $key = implode(',', $in_trans); 284 if (strlen($key)> 16)296 if (strlen($key)>24) 285 297 $key = md5($key); 286 298 … … 308 320 ); 309 321 if (!empty($params['comment'])) 310 $rule['comment'] = $params['comment'];322 $rule['comment'] = stripslashes($params['comment']); 311 323 $rules[$key] = $rule; 312 324
Note: See TracChangeset
for help on using the changeset viewer.