From 7f88c7423f0b0c8c565f7e4d4d1b37ba14e55dae Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 4 Apr 2020 17:11:25 +0200 Subject: Replace wallabag's fork of tcpdf with the original one, fix notices for PHP 7.4 Signed-off-by: Kevin Decherf --- src/Wallabag/ImportBundle/Controller/PocketController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index 71ceb427..f952867b 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php @@ -47,8 +47,12 @@ class PocketController extends Controller return $this->redirect($this->generateUrl('import_pocket')); } + $form = $request->request->get('form'); + $this->get('session')->set('import.pocket.code', $requestToken); - $this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']); + if (null !== $form && \array_key_exists('mark_as_read', $form)) { + $this->get('session')->set('mark_as_read', $form['mark_as_read']); + } return $this->redirect( 'https://getpocket.com/auth/authorize?request_token=' . $requestToken . '&redirect_uri=' . $this->generateUrl('import_pocket_callback', [], UrlGeneratorInterface::ABSOLUTE_URL), @@ -80,11 +84,11 @@ class PocketController extends Controller if (true === $pocket->setMarkAsRead($markAsRead)->import()) { $summary = $pocket->getSummary(); $message = $this->get('translator')->trans('flashes.import.notice.summary', [ - '%imported%' => $summary['imported'], - '%skipped%' => $summary['skipped'], + '%imported%' => null !== $summary && \array_key_exists('imported', $summary) ? $summary['imported'] : 0, + '%skipped%' => null !== $summary && \array_key_exists('skipped', $summary) ? $summary['skipped'] : 0, ]); - if (0 < $summary['queued']) { + if (null !== $summary && \array_key_exists('queued', $summary) && 0 < $summary['queued']) { $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [ '%queued%' => $summary['queued'], ]); -- cgit v1.2.3