Small fixes from http://sourceforge.net/tracker/?group_id=102542&atid=633302 + my own fixes. Fixes from the bugtracker: * sort the folders * bugfix for the "foo" -like email addresses My fixes: * make the sort case-insensitive * bugfix for quoted-printable messages * don't strip the newlines diff -Naur wapreader.orig/wapreader.php wapreader/wapreader.php --- wapreader.orig/wapreader.php 2005-07-08 12:32:33.000000000 +0200 +++ wapreader/wapreader.php 2006-10-08 12:47:11.000000000 +0200 @@ -28,6 +28,11 @@ //--------------- config ----------------------------------- //---------------------------------------------------------- +function cmp($a, $b) +{ + return (strtoupper($a->name) < strtoupper($b->name)) ? -1 : 1; +} + //Defaul imap/pop3 host. $host_default=""; @@ -227,6 +232,7 @@ //---------------------------------------------------- case "folders": $folders=imap_getmailboxes($box, $_SESSION["connect"], "*"); + usort($folders, "cmp"); if(!count($folders)) { ?> @@ -573,7 +579,7 @@ case "base64": $text=imap_base64($text); break; - case "quoted-printable": + case "QUOTED-PRINTABLE": $text=imap_qprint($text); break; } @@ -583,7 +589,7 @@ if(strlen($text)>$message_maxlen) $text=substr($text, 0, $message_maxlen); $text=wmlspecialchars($text); - $text=wordwrap($text, 70, "\n"); + $text=wordwrap($text, 70, "
\n"); if(!empty($info["charset"]) && $info["charset"]!="utf-8") { $text=xiconv($info["charset"], "utf-8", $text); @@ -620,7 +626,7 @@ //---------------------------------------------------- function wmlspecialchars($text) { - $text=str_replace( array("\"","'","&","<",">","$"), array(""","'","&","<",">","$$"), $text); + $text=str_replace( array("'","&","\"","<",">","$"), array("'","&",""","<",">","$$"), $text); return $text; }