Merge pull request #1 from silverstripe-security/patch/1.2/SS-2017-008

[SS-2017-008] Fix SQL injection in search engine
This commit is contained in:
Damian Mooyman 2017-12-07 15:59:04 +13:00 committed by GitHub
commit aa16771922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,6 +261,9 @@ class PostgreSQLDatabase extends SS_Database {
* @return object DataObjectSet of result pages
*/
public function searchEngine($classesToSearch, $keywords, $start, $pageLength, $sortBy = "ts_rank DESC", $extraFilter = "", $booleanSearch = false, $alternativeFileFilter = "", $invertedMatch = false) {
$start = (int)$start;
$pageLength = (int)$pageLength;
//Fix the keywords to be ts_query compatitble:
//Spaces must have pipes
//@TODO: properly handle boolean operators here.