aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2020-04-27 08:59:56 +0200
committerGitHub <noreply@github.com>2020-04-27 08:59:56 +0200
commit34fe51454ad405a49c73cf67e8adde9364cf2248 (patch)
tree3e1f6ddf2ac791fdc4892430d3f9669e6018121a /src
parentb23d9403ece494a60ecba5867bb68c94ec497052 (diff)
parent7f88c7423f0b0c8c565f7e4d4d1b37ba14e55dae (diff)
downloadwallabag-34fe51454ad405a49c73cf67e8adde9364cf2248.tar.gz
wallabag-34fe51454ad405a49c73cf67e8adde9364cf2248.tar.zst
wallabag-34fe51454ad405a49c73cf67e8adde9364cf2248.zip
Merge pull request #4309 from wallabag/fix/php-7.4
Replace wallabag's fork of tcpdf with the original one, PHP 7.4 support
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/ImportBundle/Controller/PocketController.php12
1 files changed, 8 insertions, 4 deletions
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
47 return $this->redirect($this->generateUrl('import_pocket')); 47 return $this->redirect($this->generateUrl('import_pocket'));
48 } 48 }
49 49
50 $form = $request->request->get('form');
51
50 $this->get('session')->set('import.pocket.code', $requestToken); 52 $this->get('session')->set('import.pocket.code', $requestToken);
51 $this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']); 53 if (null !== $form && \array_key_exists('mark_as_read', $form)) {
54 $this->get('session')->set('mark_as_read', $form['mark_as_read']);
55 }
52 56
53 return $this->redirect( 57 return $this->redirect(
54 'https://getpocket.com/auth/authorize?request_token=' . $requestToken . '&redirect_uri=' . $this->generateUrl('import_pocket_callback', [], UrlGeneratorInterface::ABSOLUTE_URL), 58 '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
80 if (true === $pocket->setMarkAsRead($markAsRead)->import()) { 84 if (true === $pocket->setMarkAsRead($markAsRead)->import()) {
81 $summary = $pocket->getSummary(); 85 $summary = $pocket->getSummary();
82 $message = $this->get('translator')->trans('flashes.import.notice.summary', [ 86 $message = $this->get('translator')->trans('flashes.import.notice.summary', [
83 '%imported%' => $summary['imported'], 87 '%imported%' => null !== $summary && \array_key_exists('imported', $summary) ? $summary['imported'] : 0,
84 '%skipped%' => $summary['skipped'], 88 '%skipped%' => null !== $summary && \array_key_exists('skipped', $summary) ? $summary['skipped'] : 0,
85 ]); 89 ]);
86 90
87 if (0 < $summary['queued']) { 91 if (null !== $summary && \array_key_exists('queued', $summary) && 0 < $summary['queued']) {
88 $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [ 92 $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [
89 '%queued%' => $summary['queued'], 93 '%queued%' => $summary['queued'],
90 ]); 94 ]);