diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-11-21 19:46:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-11-21 19:46:10 +0000 |
commit | bd2527a4edc8815459e2bc0783341d6849c60601 (patch) | |
tree | 2e85c46d91aaf54dc6b1e85284da136658d7202a /includes/database.mysql.inc | |
parent | e66c520aa4698853379173c3fcab87e302c82c02 (diff) | |
download | brdo-bd2527a4edc8815459e2bc0783341d6849c60601.tar.gz brdo-bd2527a4edc8815459e2bc0783341d6849c60601.tar.bz2 |
- Patch #98059 by chx: trying to get the never-ending regex mess right.
Diffstat (limited to 'includes/database.mysql.inc')
-rw-r--r-- | includes/database.mysql.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index 18eeee019..25517a310 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -431,7 +431,7 @@ function db_table_exists($table) { function db_distinct_field($table, $field, $query) { $field_to_select = 'DISTINCT('. $table .'.'. $field .')'; // (?<!text) is a negative look-behind (no need to rewrite queries that already use DISTINCT). - return preg_replace('/(SELECT.*)('. $table .'\.)?(?<!DISTINCT\()(?<!DISTINCT\('. $table .'\.)'. $field .'(.*FROM )/AUsi', '\1'. $field_to_select .'\3', $query); + return preg_replace('/(SELECT.*)(?:'. $table .'\.|\s)(?<!DISTINCT\()(?<!DISTINCT\('. $table .'\.)'. $field .'(.*FROM )/AUsi', '\1 '. $field_to_select .'\2', $query); } /** |