[sync] Infinite loop in Horde/Icalendar.php when syncing

Jan Schneider jan at horde.org
Mon Aug 22 15:43:36 UTC 2011


Zitat von Carsten Schumann <grypho at tempus-vivit.net>:

> Hi guys,
>
> I have reinstalled my horde webmail since I had to upgrade from  
> webmail 1.2.4 to 4.0.2 for my new Ipad. The web frontend works fine  
> but when I try to sync my mobile phone against kronolith, apache  
> ends up in an infinite loop in Horde/Icalendar.php:584 while trying  
> to parse the answer from my phone.
>
> The loop reads:
>
>         while  
> (preg_match_all('/^([^:]+;\s*(ENCODING=)?QUOTED-PRINTABLE(.*=\r?\n)+(.*[^=])?(\r?\n|$))/mU', $vCal, $matches))  
> {
>             foreach ($matches[1] as $s) {
>                 $r = preg_replace('/=\r?\n\s/', '', $s);
>                 $vCal = str_replace($s, $r, $vCal);
>             }
>         }
>
>
> $vCal has the value
>
> X-IRMC-LUID:3422981680^M CATEGORIES:Memo^M  
> SUMMARY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Feuerwehr:=20Baumaktion=20Au=^M fr=C3=A4umen^M DTSTART:20071201T100000Z^M  
> DTEND:20071201T120000Z
>
> and after the preg_match_all instruction, $matches[1] contains an  
> array with one element
>
> SUMMARY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Feuerwehr:=20Baumaktion=20Au=^M  
> fr=C3=A4umen^M
>
> which is not altered by the preg_replace expression. As $r==$s  
> nothing is altered by str_replace expression in $vCal. So the  
> preg_match_all matches again and again and again... ;-)
>
> Is this issue known and is there a bugfix/workaround?

No. Is that a copy and paste error, or is the data really one single  
line? It's not valid iCalendar data then.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the sync mailing list