Skip to content

Commit

Permalink
Merge pull request #291 from kyleweishaupt/cake-4.x
Browse files Browse the repository at this point in the history
Cake 4.x Stable
  • Loading branch information
dereuromark committed Dec 18, 2019
2 parents cbf6b17 + cb73d8b commit 2f40aab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -5,7 +5,7 @@
"homepage": "http://github.com/friendsofcake/CakePdf",
"license": "MIT",
"require": {
"cakephp/cakephp": "4.x-dev"
"cakephp/cakephp": "^4.0.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Pdf/CakePdf.php
Expand Up @@ -955,7 +955,7 @@ protected function _render()
$viewOptions[$var] = $this->{$prop};
}

$request = Router::getRequest(true);
$request = Router::getRequest();
if (!$request) {
$request = ServerRequestFactory::fromGlobals();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Pdf/Engine/MpdfEngine.php
Expand Up @@ -17,7 +17,8 @@ public function output()
{
$orientation = $this->_Pdf->orientation() === 'landscape' ? 'L' : 'P';
$format = $this->_Pdf->pageSize();
if (is_string($format)
if (
is_string($format)
&& $orientation === 'L'
&& strpos($format, '-L') === false
) {
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Pdf/CakePdfTest.php
Expand Up @@ -98,7 +98,7 @@ public function testCustomTemplatePaths($config)
$pdf->templatePath('Posts/pdf');
$result = $pdf->output();
$expected = '<h2>Rendered with default layout</h2>' . "\n" . 'Post data: testing';
$this->assertEquals($expected, $result);
$this->assertTextEquals($expected, $result);
}

/**
Expand Down

0 comments on commit 2f40aab

Please sign in to comment.