* Got rid of problem with passwords (finally)

* Added a new function in strings.php to quote a string to be sent to
  the IMAP server
This commit is contained in:
Tyler Akins 2001-03-05 16:14:53 +00:00
parent ec81d1d757
commit 1b97851467
2 changed files with 7 additions and 2 deletions

View file

@ -128,8 +128,8 @@
exit;
}
fputs ($imap_stream, "a001 LOGIN \"" . addslashes($username) .
'" "' . addslashes($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 **/

View file

@ -569,5 +569,10 @@
return $String;
}
function quoteIMAP($str)
{
return ereg_replace('(["\\])', '\\\\1', $str);
}
?>