Merge pull request #102 from PostgreSQL-For-Wordpress/wordpress-search

Fix Wordpress Search
This commit is contained in:
Matthew Bucci
2024-02-26 12:25:19 -08:00
committed by GitHub
2 changed files with 36 additions and 0 deletions
+3
View File
@@ -24,6 +24,9 @@ class SelectSQLRewriter extends AbstractSQLRewriter
// Remove the LIMIT clause if it exists
$sql = preg_replace('/\s+LIMIT\s+\d+(\s*,\s*\d+)?/i', '', $sql);
// Remove the ORDER BY containing case / end clause if it exists
$sql = preg_replace('/\s+ORDER\s+BY\s+.+END\),[^)]+/is', '', $sql);
// Remove the ORDER BY clause if it exists
$sql = preg_replace('/\s+ORDER\s+BY\s+[^)]+/i', '', $sql);