Skip to content

Commit

Permalink
Fixed a bug where an invalid cookie caused an error (bug #708).
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Jan 3, 2017
1 parent 39625a8 commit 45da3e5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions public_html/users.php
Expand Up @@ -554,8 +554,14 @@ function resend_request()
$req->setHeader('User-Agent', 'Geeklog/' . VERSION);
// need to fake the referrer so the new token matches
$req->setHeader('Referer', COM_getCurrentUrl());
foreach ($_COOKIE as $cookie => $value) {
$req->addCookie($cookie, $value);
foreach ($_COOKIE as $name => $value) {
$cookie = $name . '=' . $value;

if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie)) {
COM_errorLog(__FUNCTION__ . " detected invalid cookie: {$cookie}", 1);
} else {
$req->addCookie($name, $value);
}
}

try {
Expand Down

0 comments on commit 45da3e5

Please sign in to comment.