Skip to content

Commit

Permalink
Merge #15666 - Remove extra line break from downloaded blob content
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Dec 30, 2019
2 parents 0fac6a1 + e1b1f15 commit 2e624d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions libraries/classes/Header.php
Expand Up @@ -402,8 +402,8 @@ public function enablePrintView(): void
*/
public function getDisplay(): string
{
if (! $this->_headerIsSent) {
if (! $this->_isAjax && $this->_isEnabled) {
if (! $this->_headerIsSent && $this->_isEnabled) {
if (! $this->_isAjax) {
$this->sendHttpHeaders();

$baseDir = defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : '';
Expand Down Expand Up @@ -452,7 +452,7 @@ public function getDisplay(): string
$console = $this->_console->getDisplay();
$messages = $this->getMessage();
}
if ($this->_isEnabled && empty($_REQUEST['recent_table'])) {
if (empty($_REQUEST['recent_table'])) {
$recentTable = $this->_addRecentTable(
$GLOBALS['db'],
$GLOBALS['table']
Expand Down
16 changes: 15 additions & 1 deletion test/classes/HeaderTest.php
Expand Up @@ -59,7 +59,21 @@ public function testDisable()
$header = new Header();
$header->disable();
$this->assertEquals(
"\n",
'',
$header->getDisplay()
);
}

/**
* Test for enable
*
* @return void
*/
public function testEnable()
{
$header = new Header();
$this->assertStringContainsString(
'<title>phpMyAdmin</title>',
$header->getDisplay()
);
}
Expand Down

0 comments on commit 2e624d9

Please sign in to comment.