Changeset 1629 for trunk/gregarius/api.php
- Timestamp:
- 11/07/06 14:23:57 (2 years ago)
- Files:
-
- 1 modified
-
trunk/gregarius/api.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/api.php
r1613 r1629 52 52 rss_require('extlib/JSON.php'); 53 53 $json = new Services_JSON(); 54 $query = sanitize(@$_REQUEST['q'], RSS_SANITIZER_WORDS);54 $query = preg_replace('#[^a-z0-9\s]#','',@$_REQUEST['q']); 55 55 if ($query) { 56 56 $res = osSearch($query); 57 57 } else { 58 $res = array($query,array() );58 $res = array($query,array(),array(),array()); 59 59 } 60 header('Content-Type: application/json');60 header('Content-Type: text/plain'); 61 61 die ($json->encode($res)); 62 62 break; … … 218 218 } 219 219 } 220 return array($q,$results );220 return array($q,$results,array(),array()); 221 221 } 222 222 ?>
