$size = 0;
}
- $data = Array();
+ $data = array();
$total_size = 0;
$continue = true;
if ($total_size == $size) {
$data[] = $read;
$read = fgets($imap_stream, 9096);
- $read = fgets($imap_stream, 9096);
+ while (!ereg("^$pre (OK|BAD|NO)(.*)$", $read, $regs)) {
+ $read = fgets($imap_stream, 9096);
+ }
$continue = false;
} else if ($total_size > $size) {
$difference = $total_size - $size;
if ($response == 'NO') {
// ignore this error from m$ exchange, it is not fatal (aka bug)
- if (!ereg('command resulted in',$message)) {
+ if (strstr($message, 'command resulted in') === false) {
set_up_language($squirrelmail_language);
echo "<br><b><font color=$color[2]>\n";
echo _("ERROR : Could not complete request.");
exit;
}
- fputs ($imap_stream, "a001 LOGIN \"" . quotemeta($username) .
- '" "' . quotemeta($password) . "\"\r\n");
+ fputs ($imap_stream, "a001 LOGIN \"" . quoteIMAP($username) .
+ '" "' . quoteIMAP($password) . "\"\r\n");
$read = sqimap_read_data ($imap_stream, 'a001', false, $response, $message);
/** If the connection was not successful, lets see why **/
*/
fputs ($imap_stream, "a001 NAMESPACE\r\n");
$read = sqimap_read_data($imap_stream, 'a001', true, $a, $b);
- if (eregi('\* NAMESPACE +(\( *\(.+\) *\)|NIL) +(\( *\(.+\) *\)|NIL) +(\( *\(.+\) *\)|NIL)', $read[0], $data)) {
- if (eregi('^\( *\((.*)\) *\)', $data[1], $data2))
+ if (eregi('\\* NAMESPACE +(\\( *\\(.+\\) *\\)|NIL) +(\\( *\\(.+\\) *\\)|NIL) +(\\( *\\(.+\\) *\\)|NIL)', $read[0], $data)) {
+ if (eregi('^\\( *\\((.*)\\) *\\)', $data[1], $data2))
$pn = $data2[1];
$pna = explode(')(', $pn);
while (list($k, $v) = each($pna))