Roundcube-AutoLogin icon indicating copy to clipboard operation
Roundcube-AutoLogin copied to clipboard

RoundCube 1.3.10 - lower case "set-cookie:" headers

Open directadminjohn opened this issue 5 years ago • 2 comments

RoundCube 1.3.10 changed their: Set-Cookie:

headers, to: set-cookie:

So this match fails: preg_match_all('/Set-Cookie: (.*)\b/', $response, $cookies);

Simply add the case-insensitive 'i' flag to it, to handle both cases: preg_match_all('/Set-Cookie: (.*)\b/i', $response, $cookies);

directadminjohn avatar Aug 30 '19 07:08 directadminjohn

See also https://github.com/alexjeen/Roundcube-AutoLogin/pull/13

tpo avatar Apr 18 '22 13:04 tpo

this simpel patch solve the situation for OLDER AND NEWER version of RC,using case-insensitive comparison:

@@ -70,7 +70,7 @@ public function login($email, $password)
            if($response_info['http_code'] == 302)
            {
                // find all relevant cookies to set (php session + rc auth cookie)
-                preg_match_all('/set-cookie: (.*)\b/', $response, $cookies);
+               preg_match_all('/set-cookie: (.*)\b/i', $response, $cookies);

                $cookie_return = array();

mckaygerhard avatar Jul 18 '22 20:07 mckaygerhard