Skip to content

Commit

Permalink
Merge pull request #276 from johanmeiring/fix-php-7.2
Browse files Browse the repository at this point in the history
Fix problem related to session-handling in PHP 7.2
  • Loading branch information
ADmad authored Oct 31, 2018
2 parents 710a838 + ad0378c commit 44451b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Pdf/CakePdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Cake\Core\Exception\Exception;
use Cake\Filesystem\File;
use Cake\Http\ServerRequestFactory;
use Cake\Routing\Router;

class CakePdf
{
Expand Down Expand Up @@ -953,8 +954,13 @@ protected function _render()
$viewOptions[$var] = $this->{$prop};
}

$request = Router::getRequest(true);
if (!$request) {
$request = ServerRequestFactory::fromGlobals();
}

$View = new $viewClass(
ServerRequestFactory::fromGlobals(),
$request,
null,
null,
$viewOptions
Expand Down

0 comments on commit 44451b4

Please sign in to comment.