Author: leithoff
New Revision: 55745
URL: http://svn.stylite.de/viewvc/egroupware?rev=55745&view=rev
Log:
try to prevent infinite loops when decoding mail-headers
Modified:
trunk/egroupware/api/src/Mail/Html.php
— trunk/egroupware/api/src/Mail/Html.php (original)
+++ trunk/egroupware/api/src/Mail/Html.php Thu Apr 14 16:28:41 2016
@@ -29,6 +29,14 @@
/
static function decodeMailHeader($_string, $displayCharset=‘utf-8’)
{
+/
+*/
//error_log(FILE.’,’.METHOD.’:’.“called with $_string and CHARSET $displayCharset”);
if(function_exists(‘imap_mime_header_decode’))
{
@@ -62,12 +70,23 @@
{
if( strtoupper($element->charset) != ‘UTF-8’) $element->text = preg_replace($sar,$rar,$element->text);
// check if there is a possible nested encoding; make sure that the inputstring and the decoded result are different to avoid loops
-
$openTags = substr_count($element->text,'?=');
-
if(preg_match('/\?=.+=\?/', $element->text) && $openTags>0 && $openTags==substr_count($element->text,'=?') && $element->text != $_string)
{
$element->text = self::decodeMailHeader($element->text, $element->charset);
$element->charset = $displayCharset;
}
+/* //try to be smart about concatenating
+error_log(METHOD.LINE.$translatedString);
+error_log(METHOD.LINE.$newString);
-
if ($translatedString && $newString && strpos($translatedString,$newString)===0)
-
{
-
$newString = $translatedString;
-
}
-
else
+*/
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs