if (isset($response) && $response->isAjax() && $token_mismatch) { $response->isSuccess(false); $response->addJSON('message', PMA_Message::error(__('Error: Token mismatch'))); exit; } } else { // end if !defined('PMA_MINIMUM_COMMON') // load user preferences $GLOBALS['PMA_Config']->loadUserPreferences(); } // remove sensitive values from session $GLOBALS['PMA_Config']->set('blowfish_secret', ''); $GLOBALS['PMA_Config']->set('Servers', ''); $GLOBALS['PMA_Config']->set('default_server', ''); /* Tell tracker that it can actually work */ PMA_Tracker::enable(); /** * @global boolean $GLOBALS['is_ajax_request'] * @todo should this be moved to the variables init section above? * * Check if the current request is an AJAX request, and set is_ajax_request * accordingly. Suppress headers, footers and unnecessary output if set to * true */ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { $GLOBALS['is_ajax_request'] = true; } else { $GLOBALS['is_ajax_request'] = false; } if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) { PMA_fatalError(__("GLOBALS overwrite attempt"));
/** * Test for PMA_Tracker::isTracked() * * @return void * @test */ public function testIsTracked() { $attr = new \ReflectionProperty('PMA_Tracker', 'enabled'); $attr->setAccessible(true); $attr->setValue(null, false); $reflection = new \ReflectionProperty('PMA_Tracker', 'pma_table'); $reflection->setAccessible(true); $reflection->setValue(null, 'pma_table_tracking'); $this->assertFalse( PMA_Tracker::isTracked("", "") ); PMA_Tracker::enable(); $_SESSION['relation'][$GLOBALS['server']]['trackingwork'] = false; $this->assertFalse( PMA_Tracker::isTracked("", "") ); $_SESSION['relation'][$GLOBALS['server']]['trackingwork'] = true; $this->assertTrue( PMA_Tracker::isTracked("pma_test_db", "pma_test_table") ); $reflection->setValue(null, 'pma_table_tracking'); $this->assertFalse( PMA_Tracker::isTracked("pma_test_db", "pma_test_table2") ); }