From 695ea50f2e7ec406f4a2adb8115a88b21a23d2c4 Mon Sep 17 00:00:00 2001 From: elliotls Date: Mon, 30 Nov 2020 17:20:20 +1300 Subject: [PATCH] Fix getPageContent creating additional session --- src/SeoObjectExtension.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SeoObjectExtension.php b/src/SeoObjectExtension.php index 832b216..3415a5c 100644 --- a/src/SeoObjectExtension.php +++ b/src/SeoObjectExtension.php @@ -307,7 +307,7 @@ public function getSEOSocialLocale() * Attempt to find a suitable social image to use if one is not set. * By default try to see if this is a blog post and add the "Featured Image" * - * @return Image + * @return Image */ public function getSEOPreferedSocialImage() { @@ -808,7 +808,11 @@ public function getNumCharsTitle() { */ public function getPageContent() { - $response = Director::test($this->owner->Link()); + $session = []; + if (Controller::has_curr()) { + $session = Controller::curr()->getRequest()->getSession(); + } + $response = Director::test($this->owner->Link(), [], $session); if (!$response->isError()) { return $response->getBody();