HOTFIX Unset corrupted cookies
This commit is contained in:
@@ -62,22 +62,29 @@ class BookingUrlUtility
|
||||
|
||||
$query = static::buildQuery($bookingId, $hotelId, $dateEnd, $template, $isDayTrip);
|
||||
|
||||
$cookie = $_COOKIE[static::COOKIE_NAME];
|
||||
if (strpos($cookie, '?') !== false) {
|
||||
$items = GeneralUtility::trimExplode('?', $cookie);
|
||||
$cookie = $items[0];
|
||||
}
|
||||
$bpnCookie = $_COOKIE[static::COOKIE_NAME_BPN];
|
||||
$trackingCookie = null;
|
||||
$bpnCookie = null;
|
||||
|
||||
if ($paCode !== null) {
|
||||
$query['agenturcode'] = $paCode;
|
||||
} elseif (!empty($bpnCookie)) {
|
||||
$query['agenturcode'] = $bpnCookie;
|
||||
} elseif (!empty($cookie)) {
|
||||
if (preg_match('/^P[a-zA-Z0-9]*/', $cookie)) {
|
||||
$query['agenturcode'] = $cookie;
|
||||
if (isset($_COOKIE[static::COOKIE_NAME])) {
|
||||
if (false === preg_match('/([a-z]{4}|PA)\d{4}/', $_COOKIE[static::COOKIE_NAME])) {
|
||||
setcookie(static::COOKIE_NAME, '', time() - 3600);
|
||||
} else {
|
||||
$query['crminfo'] = $cookie;
|
||||
$trackingCookie = $_COOKIE[static::COOKIE_NAME];
|
||||
}
|
||||
}
|
||||
if (isset($_COOKIE[static::COOKIE_NAME_BPN])) {
|
||||
$bpnCookie = $_COOKIE[static::COOKIE_NAME_BPN];
|
||||
}
|
||||
|
||||
if ($paCode) {
|
||||
$query['agenturcode'] = $paCode;
|
||||
} elseif ($bpnCookie) {
|
||||
$query['agenturcode'] = $bpnCookie;
|
||||
} elseif ($trackingCookie) {
|
||||
if (preg_match('/^PA\d+/', $trackingCookie)) {
|
||||
$query['agenturcode'] = $trackingCookie;
|
||||
} else {
|
||||
$query['crminfo'] = $trackingCookie;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user