diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-11-07 17:21:54 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-11-07 17:21:54 +0000 |
commit | af0463c66aaeda66a078ecfda46cc81c49599859 (patch) | |
tree | 74d7d216c0bf4e40d34e233858883847774fedc5 /includes/database/database.inc | |
parent | f9fd9c3bf8bcd5f2ddf9c02e520ed6872046e92b (diff) | |
download | brdo-af0463c66aaeda66a078ecfda46cc81c49599859.tar.gz brdo-af0463c66aaeda66a078ecfda46cc81c49599859.tar.bz2 |
- Patch #279516 by c960657: remove workarounds for PHP versions less than 5.2.x
Diffstat (limited to 'includes/database/database.inc')
-rw-r--r-- | includes/database/database.inc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc index bb5338631..2a4fab9c3 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -2211,12 +2211,8 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $ $n = strlen($matches[1]); $second_part = substr($query, $n); $first_part = substr($matches[1], 0, $n - 5) ." $join WHERE $where AND ( "; - // PHP 4 does not support strrpos for strings. We emulate it. - $haystack_reverse = strrev($second_part); - // No need to use strrev on the needle, we supply GROUP, ORDER, LIMIT - // reversed. - foreach (array('PUORG', 'REDRO', 'TIMIL') as $needle_reverse) { - $pos = strpos($haystack_reverse, $needle_reverse); + foreach (array('GROUP', 'ORDER', 'LIMIT') as $needle) { + $pos = strrpos($second_part, $needle); if ($pos !== FALSE) { // All needles are five characters long. $pos += 5; |