From a63e10ee7d43ab71ed4b66c51a1f78badb69e25d Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 14 Apr 2008 10:11:50 +0000 Subject: - removed strrstr() definition as it was needed only for php4 --- program/include/rcube_shared.inc | 23 ----------------------- program/steps/mail/compose.inc | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) (limited to 'program') diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index f3ff0aa02..556cffd50 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -658,29 +658,6 @@ function get_offset_time($offset_str, $factor=1) } -/** - * Return the last occurence of a string in another string - * - * @param haystack string string in which to search - * @param needle string string for which to search - * @return index of needle within haystack, or false if not found - */ -function strrstr($haystack, $needle) -{ - $pver = phpversion(); - if ($pver[0] >= 5) - return strrpos($haystack, $needle); - else - { - $index = strpos(strrev($haystack), strrev($needle)); - if($index === false) - return false; - - $index = strlen($haystack) - strlen($needle) - $index; - return $index; - } -} - /** * A method to guess the mime_type of an attachment. * diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index aaeca24dd..878cf8634 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -499,7 +499,7 @@ function rcmail_create_reply_body($body, $bodyIsHtml) $IMAP->decode_header($MESSAGE['headers']->from)); // try to remove the signature - if ($sp = strrstr($body, '-- ')) + if ($sp = strrpos($body, '-- ')) { if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r") $body = substr($body, 0, $sp-1); -- cgit v1.2.3