From af0463c66aaeda66a078ecfda46cc81c49599859 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 7 Nov 2008 17:21:54 +0000 Subject: - Patch #279516 by c960657: remove workarounds for PHP versions less than 5.2.x --- includes/database/database.inc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'includes/database/database.inc') 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; -- cgit v1.2.3