Skip to content

Commit

Permalink
Fixes zetacomponents#51: User names and passwords need to be escaped …
Browse files Browse the repository at this point in the history
…if they contain spaces
  • Loading branch information
mfb authored and derickr committed Feb 13, 2019
1 parent ecd3c92 commit b92ef11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/transports/imap/imap_transport.php
Expand Up @@ -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 )
Expand Down

0 comments on commit b92ef11

Please sign in to comment.