Merge remote-tracking branch 'origin/master'

This commit is contained in:
Michal Čihař 2012-06-25 12:18:11 +02:00
commit 190a04ba1f
6 changed files with 38 additions and 10 deletions

View File

@ -12,7 +12,7 @@ if (! defined('PHPMYADMIN')) {
/**
* Load vendor configuration.
*/
require './libraries/vendor_config.php';
require_once './libraries/vendor_config.php';
/**
* Configuration class

View File

@ -106,7 +106,7 @@ class PMA_Footer
// set current db, table and sql query in the querywindow
$query = '';
if (strlen($GLOBALS['sql_query']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
if (isset($GLOBALS['sql_query']) && strlen($GLOBALS['sql_query']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
$query = PMA_escapeJsString($GLOBALS['sql_query']);
}
$this->_scripts->addCode("

View File

@ -335,7 +335,7 @@ class PMA_Header
*/
$GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT';
/* Prevent against ClickJacking by allowing frames only from same origin */
if (! $GLOBALS['cfg']['AllowThirdPartyFraming']) {
if (! $GLOBALS['cfg']['AllowThirdPartyFraming'] && ! defined('TESTSUITE')) {
header(
'X-Frame-Options: SAMEORIGIN'
);
@ -351,7 +351,7 @@ class PMA_Header
);
}
PMA_noCacheHeader();
if (! defined('IS_TRANSFORMATION_WRAPPER')) {
if (! defined('IS_TRANSFORMATION_WRAPPER') && ! defined('TESTSUITE')) {
// Define the charset to be used
header('Content-Type: text/html; charset=utf-8');
}

View File

@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
*
*
* @package PhpMyAdmin
*/
@ -10,7 +10,7 @@ if (! defined('PHPMYADMIN')) {
}
/**
*
*
*
* @package PhpMyAdmin
*/
@ -85,7 +85,9 @@ class PMA_OutputBuffering
ob_start('ob_gzhandler');
}
ob_start();
header('X-ob_mode: ' . $this->_mode);
if (! defined('TESTSUITE')) {
header('X-ob_mode: ' . $this->_mode);
}
register_shutdown_function('PMA_OutputBuffering::stop');
$this->_on = true;
}

View File

@ -575,6 +575,9 @@ function PMA_sendHeaderLocation($uri, $use_refresh = false)
*/
function PMA_noCacheHeader()
{
if (defined('TESTSUITE')) {
return;
}
// rfc2616 - Section 14.21
header('Expires: ' . date(DATE_RFC1123));
// HTTP/1.1

View File

@ -12,15 +12,38 @@
/*
* Include to test.
*/
require_once 'libraries/select_lang.lib.php';
require_once 'libraries/vendor_config.php';
require_once 'libraries/core.lib.php';
require_once 'libraries/common.lib.php';
require_once 'libraries/js_escape.lib.php';
require_once 'libraries/select_lang.lib.php';
require_once 'libraries/sanitizing.lib.php';
require_once 'libraries/Config.class.php';
require_once 'libraries/vendor_config.php';
require_once 'libraries/url_generating.lib.php';
require_once 'libraries/Theme.class.php';
require_once 'libraries/Table.class.php';
require_once 'libraries/php-gettext/gettext.inc';
class PMA_fatalError_test extends PHPUnit_Framework_TestCase
{
public function setup()
{
$GLOBALS['PMA_Config'] = new PMA_Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['cfg']['Server'] = array(
'host' => 'host',
'verbose' => 'verbose',
);
$GLOBALS['cfg']['OBGzip'] = false;
$_SESSION['PMA_Theme'] = new PMA_Theme();
$_SESSION[' PMA_token '] = 'token';
$GLOBALS['pmaThemeImage'] = 'theme/';
$GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath();
$GLOBALS['server'] = 1;
$GLOBALS['db'] = '';
$GLOBALS['table'] = '';
}
public function testFatalErrorMessage()
{
$this->expectOutputRegex("/FatalError!/");
@ -42,4 +65,4 @@ class PMA_fatalError_test extends PHPUnit_Framework_TestCase
PMA_fatalError($message, $params);
}
}
}