Fix newline trim

When using with <br /> format it now allows for 'b' and 'r' chars at the end of last line.
I think rtrim is not suitable when used with a word rather than a charlist.
This commit is contained in:
Guillaume Lafarge committed 2013-12-04 17:42:32 +01:00
1 parent d1959f87d4
commit 39ded96964
1 file changed
+1 -1
+1 -1
View File
@@ -379,7 +379,7 @@ class AddressFormatCore extends ObjectModel
$addressText .= (!empty($tmpText)) ? $tmpText.$newLine: ''; $addressText .= (!empty($tmpText)) ? $tmpText.$newLine: '';
} }
$addressText = rtrim($addressText, $newLine); $addressText = preg_replace('/'.preg_quote($newLine,'/').'$/i', '', $addressText);
$addressText = rtrim($addressText, $separator); $addressText = rtrim($addressText, $separator);
return $addressText; return $addressText;