Hello,
I try to write in English.
A normal Reply-Mail starts with 'Re: ' in the subject.
But there are some german Mail-Reader which are using other tag's like: RE: Betreff: AW: WG: Antwort:
If I'm writing an reply the new subject looks like 'Re: WG: Antwort: Test' I think that looks unprofessional! A better style is: 'Re: Test'
For this I did a code-change in program/steps/mail/compose.php starting at line 905
<snip> else if ($compose_mode == RCUBE_COMPOSE_REPLY) { $MESSAGE->subject = ltrim($MESSAGE->subject, "RE:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "Betreff:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "Re:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "AW:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "WG:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "Antwort:");
if (preg_match('/^re:/i', $MESSAGE->subject))
</snip>
But sometimes are too many characters deleted - I don't know why!
Best regards from Germany, palatinate
Ulli
On 11/11/2010 02:37 PM, Ulli Heist wrote:
For this I did a code-change in program/steps/mail/compose.php starting at line 905
<snip> else if ($compose_mode == RCUBE_COMPOSE_REPLY) { $MESSAGE->subject = ltrim($MESSAGE->subject, "RE:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "Betreff:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "Re:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "AW:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "WG:"); $MESSAGE->subject = ltrim($MESSAGE->subject, "Antwort:");
if (preg_match('/^re:/i', $MESSAGE->subject))
</snip>
But sometimes are too many characters deleted - I don't know why!
The ltrim function doesn't do what you think it does. The second parameter is a list (string) of characters that will be trimmed from the left side of $MESSAGE->subject.
So,
ltrim("Betreff:the funniest cat video", "Betreff:")
would get trimmed to,
he funniest cat video
because the leading 't' in "the" is in the list of characters to remove.
You probably want preg_replace instead:
http://www.php.net/manual/en/function.preg-replace.php _______________________________________________ List info: http://lists.roundcube.net/users/ BT/9b404e9e