Skip to content
Permalink
Browse files

Fixes zetacomponents#51: User names and passwords need to be escaped …

…if they contain spaces
  • Loading branch information...
mfb authored and derickr committed Feb 11, 2019
1 parent ecd3c92 commit b92ef1162dac3f7d2c4bcf6bfb4c8ef4b84c0112
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/transports/imap/imap_transport.php
@@ -543,7 +543,9 @@ public function authenticate( $user, $password )
}
$tag = $this->getNextTag();
$this->connection->sendData( "{$tag} LOGIN {$user} {$password}" );
$user = addcslashes($user, '\"');
$password = addcslashes($password, '\"');
$this->connection->sendData( "{$tag} LOGIN \"{$user}\" \"{$password}\"" );
$response = trim( $this->connection->getLine() );
// hack for gmail, to fix issue #15837: imap.google.com (google gmail) changed IMAP response
if ( $this->serverType === self::SERVER_GIMAP && strpos( $response, "* CAPABILITY" ) === 0 )

0 comments on commit b92ef11

Please sign in to comment.
You can’t perform that action at this time.