alecpl
2008-04-14 a63e10ee7d43ab71ed4b66c51a1f78badb69e25d
- removed strrstr() definition as it was needed only for php4


2 files modified
25 ■■■■■ changed files
program/include/rcube_shared.inc 23 ●●●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 2 ●●● patch | view | raw | blame | history
program/include/rcube_shared.inc
@@ -659,29 +659,6 @@
/**
 * 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.
 *
 * @param string $path     Path to the file.
program/steps/mail/compose.inc
@@ -499,7 +499,7 @@
             $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);