Changeset 1628 for branches/multiuser/cls
- Timestamp:
- 11/07/06 07:34:01 (2 years ago)
- Location:
- branches/multiuser/cls
- Files:
-
- 2 modified
-
l10n.php (modified) (1 diff)
-
search.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/multiuser/cls/l10n.php
r1606 r1628 80 80 if (isset($_REQUEST['lang']) && preg_match('#^[a-z]{2}_?([A-Z]{2})?$#',$_REQUEST['lang']) && ($_REQUEST['lang'] == 'en' || file_exists(GREGARIUS_HOME .'intl/'.$_REQUEST['lang']))) { 81 81 $this -> __setLocaleCookie($_REQUEST['lang']); 82 rss_invalidate_cache(); 82 83 return $_REQUEST['lang']; 83 84 } elseif (isset($_COOKIE[RSS_LOCALE_COOKIE])) { -
branches/multiuser/cls/search.php
r1604 r1628 43 43 define ('QUERY_MATCH_EXACT','exact'); 44 44 45 // This is needed for some constants 46 rss_require('cls/wrappers/toolkit.php'); 45 47 46 48 class SearchItemList extends ItemList { … … 51 53 52 54 var $currentPage; 53 var $resultsPerPage ;55 var $resultsPerPage = 0; 54 56 var $startItem; 55 57 var $endItem; … … 58 60 var $logicSep; 59 61 60 function SearchItemList( ) {62 function SearchItemList($query=null,$results=0) { 61 63 parent::ItemList(); 64 if ($query) { 65 $this -> query=$query; 66 } elseif(isset($_REQUEST[QUERY_PRM])) { 67 $this->query = $_REQUEST[QUERY_PRM]; 68 }else{ 69 $this -> query = null; 70 } 71 72 73 // Sanitize the query parameters: 74 // fixme: this probably breaks on queries with weird characters, depending 75 // on the locale. 76 // see: http://php.benscom.com/manual/en/reference.pcre.pattern.syntax.php 77 if ($this -> query) { 78 $this -> query = trim(preg_replace('#[^\w\s\x80-\xff]#','',$this -> query)); 79 } 80 81 $this->resultsPerPage = (int) $results; 82 62 83 $this -> populate(); 63 84 … … 101 122 102 123 function populate() { 103 if (!isset($_REQUEST[QUERY_PRM])) {104 return;105 }106 107 // fixme: this probably breaks on queries with weird characters, depending108 // on the locale.109 // see: http://php.benscom.com/manual/en/reference.pcre.pattern.syntax.php110 $this->query = trim(preg_replace('#[^\w\s\x80-\xff]#','',$_REQUEST[QUERY_PRM]));111 124 112 125 if (!$this->query) { … … 122 135 RSS_SANITIZER_NUMERIC); 123 136 124 $this->resultsPerPage = sanitize( 125 ((array_key_exists(QUERY_RESULTS, $_REQUEST)) ? $_REQUEST[QUERY_RESULTS] : INFINE_RESULTS), 126 RSS_SANITIZER_NUMERIC); 127 137 if (!$this->resultsPerPage) { 138 $this->resultsPerPage = sanitize( 139 ((array_key_exists(QUERY_RESULTS, $_REQUEST)) ? $_REQUEST[QUERY_RESULTS] : INFINE_RESULTS), 140 RSS_SANITIZER_NUMERIC); 141 } 142 128 143 $this->currentPage = sanitize( 129 144 (array_key_exists(QUERY_CURRENT_PAGE, $_REQUEST) ? $_REQUEST[QUERY_CURRENT_PAGE] : 0),
