function SearchItemList($query = null, $results = 0) { parent::ItemList(); if ($query) { $this->query = $query; } elseif (isset($_REQUEST[QUERY_PRM])) { $this->query = $_REQUEST[QUERY_PRM]; } else { $this->query = null; } // Sanitize the query parameters: // fixme: this probably breaks on queries with weird characters, depending // on the locale. // see: http://php.benscom.com/manual/en/reference.pcre.pattern.syntax.php if ($this->query) { $this->query = trim(preg_replace('#[^\\w\\s\\x80-\\xff]#', '', $this->query)); } $this->resultsPerPage = (int) $results; $this->populate(); $this->humanReadableQuery = implode(" " . strtoupper($this->logicSep) . " ", $this->searchTerms); }
function PaginatedItemList($itemsPerPage = null) { parent::ItemList(); if (isset($_REQUEST['page'])) { $this->page = sanitize($_REQUEST['page'], RSS_SANITIZER_NUMERIC); } else { $this->page = 0; } if ($itemsPerPage === null) { $this->itemsPerPage = getConfig('rss.output.frontpage.numitems'); } else { $this->itemsPerPage = $itemsPerPage; } if ($this->itemsPerPage <= 0) { $this->itemsPerPage = 50; } }