Merge pull request #11552 from madhuracj/cookie

Fix #11551 Fatal error when switched to master from QA_4_5
This commit is contained in:
Marc Delisle 2015-10-09 21:05:58 -04:00
commit 9b85cdbbd4

View File

@ -285,17 +285,18 @@ $GLOBALS['PMA_Config']->enableBc();
* clean cookies on upgrade
* when changing something related to PMA cookies, increment the cookie version
*/
$pma_cookie_version = 4;
if (isset($_COOKIE)
&& (isset($_COOKIE['pmaCookieVer'])
&& $_COOKIE['pmaCookieVer'] < $pma_cookie_version)
) {
// delete all cookies
foreach ($_COOKIE as $cookie_name => $tmp) {
$GLOBALS['PMA_Config']->removeCookie($cookie_name);
$pma_cookie_version = 5;
if (isset($_COOKIE)) {
if (! isset($_COOKIE['pmaCookieVer'])
|| $_COOKIE['pmaCookieVer'] != $pma_cookie_version
) {
// delete all cookies
foreach ($_COOKIE as $cookie_name => $tmp) {
$GLOBALS['PMA_Config']->removeCookie($cookie_name);
}
$_COOKIE = array();
$GLOBALS['PMA_Config']->setCookie('pmaCookieVer', $pma_cookie_version);
}
$_COOKIE = array();
$GLOBALS['PMA_Config']->setCookie('pmaCookieVer', $pma_cookie_version);
}