diff --git a/CHANGELOG.md b/CHANGELOG.md index 4442dba80..e90e27e84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [2.6.8](https://github.com/wallabag/wallabag/tree/2.6.8) +[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.7...2.6.8) + +### Fixes +* Update deps & Node 20 by @j0k3r in https://github.com/wallabag/wallabag/pull/7134 +* Fix dark mode disabled url 2.6 by @Simounet in https://github.com/wallabag/wallabag/pull/7133 +* Make database dependent commands lazy by @yguedidi in https://github.com/wallabag/wallabag/pull/7142 +* Fix docker setup by @yguedidi in https://github.com/wallabag/wallabag/pull/7141 +* Remove session-based redirection by @yguedidi in https://github.com/wallabag/wallabag/pull/7140 + ## [2.6.7](https://github.com/wallabag/wallabag/tree/2.6.7) [Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.6...2.6.7) diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index 7beb915d3..ee4ba86f9 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml @@ -1,5 +1,5 @@ wallabag_core: - version: 2.6.7 + version: 2.6.8 paypal_url: "https://liberapay.com/wallabag/donate" languages: en: 'English' diff --git a/composer.lock b/composer.lock index d2c2ee08f..7bbbda4eb 100644 --- a/composer.lock +++ b/composer.lock @@ -7237,16 +7237,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.34", + "version": "3.0.35", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "56c79f16a6ae17e42089c06a2144467acc35348a" + "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56c79f16a6ae17e42089c06a2144467acc35348a", - "reference": "56c79f16a6ae17e42089c06a2144467acc35348a", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4b1827beabce71953ca479485c0ae9c51287f2fe", + "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe", "shasum": "" }, "require": { @@ -7327,7 +7327,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.34" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.35" }, "funding": [ { @@ -7343,7 +7343,7 @@ "type": "tidelift" } ], - "time": "2023-11-27T11:13:31+00:00" + "time": "2023-12-29T01:59:53+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -9273,16 +9273,16 @@ }, { "name": "symfony/cache", - "version": "v5.4.32", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "2553faca77502a4f68dc93cd2f3b9ec650751e40" + "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/2553faca77502a4f68dc93cd2f3b9ec650751e40", - "reference": "2553faca77502a4f68dc93cd2f3b9ec650751e40", + "url": "https://api.github.com/repos/symfony/cache/zipball/b17f28169f7a2f2c0cddf2b044d729f5b75efe5a", + "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a", "shasum": "" }, "require": { @@ -9350,7 +9350,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.32" + "source": "https://github.com/symfony/cache/tree/v5.4.34" }, "funding": [ { @@ -9366,7 +9366,7 @@ "type": "tidelift" } ], - "time": "2023-11-24T13:04:07+00:00" + "time": "2023-12-18T14:56:06+00:00" }, { "name": "symfony/cache-contracts", @@ -10749,16 +10749,16 @@ }, { "name": "symfony/http-client", - "version": "v5.4.31", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "6cdf6cdf48101454f014a9ab4e0905f0b902389d" + "reference": "8fe833b758bc5b325e9d96a913376d6d57a90fb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/6cdf6cdf48101454f014a9ab4e0905f0b902389d", - "reference": "6cdf6cdf48101454f014a9ab4e0905f0b902389d", + "url": "https://api.github.com/repos/symfony/http-client/zipball/8fe833b758bc5b325e9d96a913376d6d57a90fb0", + "reference": "8fe833b758bc5b325e9d96a913376d6d57a90fb0", "shasum": "" }, "require": { @@ -10820,7 +10820,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v5.4.31" + "source": "https://github.com/symfony/http-client/tree/v5.4.34" }, "funding": [ { @@ -10836,7 +10836,7 @@ "type": "tidelift" } ], - "time": "2023-10-29T12:33:05+00:00" + "time": "2023-12-02T08:41:43+00:00" }, { "name": "symfony/http-client-contracts", @@ -13117,16 +13117,16 @@ }, { "name": "symfony/serializer", - "version": "v5.4.33", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "d751878816665fa3e51c75f01d31c6ee62e94ce5" + "reference": "b8353e4208e9161f34d22c4631c63404b26ba929" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/d751878816665fa3e51c75f01d31c6ee62e94ce5", - "reference": "d751878816665fa3e51c75f01d31c6ee62e94ce5", + "url": "https://api.github.com/repos/symfony/serializer/zipball/b8353e4208e9161f34d22c4631c63404b26ba929", + "reference": "b8353e4208e9161f34d22c4631c63404b26ba929", "shasum": "" }, "require": { @@ -13200,7 +13200,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v5.4.33" + "source": "https://github.com/symfony/serializer/tree/v5.4.34" }, "funding": [ { @@ -13216,7 +13216,7 @@ "type": "tidelift" } ], - "time": "2023-12-01T10:42:49+00:00" + "time": "2023-12-27T08:53:17+00:00" }, { "name": "symfony/service-contracts", @@ -13365,16 +13365,16 @@ }, { "name": "symfony/string", - "version": "v5.4.32", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "91bf4453d65d8231688a04376c3a40efe0770f04" + "reference": "e3f98bfc7885c957488f443df82d97814a3ce061" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/91bf4453d65d8231688a04376c3a40efe0770f04", - "reference": "91bf4453d65d8231688a04376c3a40efe0770f04", + "url": "https://api.github.com/repos/symfony/string/zipball/e3f98bfc7885c957488f443df82d97814a3ce061", + "reference": "e3f98bfc7885c957488f443df82d97814a3ce061", "shasum": "" }, "require": { @@ -13431,7 +13431,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.32" + "source": "https://github.com/symfony/string/tree/v5.4.34" }, "funding": [ { @@ -13447,7 +13447,7 @@ "type": "tidelift" } ], - "time": "2023-11-26T13:43:46+00:00" + "time": "2023-12-09T13:20:28+00:00" }, { "name": "symfony/templating", @@ -18736,16 +18736,16 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v6.4.1", + "version": "v6.4.2", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "cca5373a41d45edbeaf38b7b67f376da2205ff95" + "reference": "bd0455b7888e4adac29cf175d819c51f88fed942" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/cca5373a41d45edbeaf38b7b67f376da2205ff95", - "reference": "cca5373a41d45edbeaf38b7b67f376da2205ff95", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/bd0455b7888e4adac29cf175d819c51f88fed942", + "reference": "bd0455b7888e4adac29cf175d819c51f88fed942", "shasum": "" }, "require": { @@ -18797,7 +18797,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.1" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.2" }, "funding": [ { @@ -18813,20 +18813,20 @@ "type": "tidelift" } ], - "time": "2023-12-01T09:25:07+00:00" + "time": "2023-12-19T09:12:31+00:00" }, { "name": "symfony/process", - "version": "v5.4.28", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b" + "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", - "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", + "url": "https://api.github.com/repos/symfony/process/zipball/8fa22178dfc368911dbd513b431cd9b06f9afe7a", + "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a", "shasum": "" }, "require": { @@ -18859,7 +18859,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.28" + "source": "https://github.com/symfony/process/tree/v5.4.34" }, "funding": [ { @@ -18875,7 +18875,7 @@ "type": "tidelift" } ], - "time": "2023-08-07T10:36:04+00:00" + "time": "2023-12-02T08:41:43+00:00" }, { "name": "symfony/web-profiler-bundle", diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index fdf3b1dc0..03b5bbefb 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -34,6 +34,7 @@ use Wallabag\CoreBundle\Form\Type\IgnoreOriginUserRuleType; use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType; use Wallabag\CoreBundle\Form\Type\TaggingRuleType; use Wallabag\CoreBundle\Form\Type\UserInformationType; +use Wallabag\CoreBundle\Helper\Redirect; use Wallabag\CoreBundle\Repository\ConfigRepository; use Wallabag\CoreBundle\Repository\EntryRepository; use Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository; @@ -51,6 +52,7 @@ class ConfigController extends AbstractController private AnnotationRepository $annotationRepository; private ConfigRepository $configRepository; private EventDispatcherInterface $eventDispatcher; + private Redirect $redirectHelper; public function __construct( EntityManagerInterface $entityManager, @@ -59,7 +61,8 @@ class ConfigController extends AbstractController TagRepository $tagRepository, AnnotationRepository $annotationRepository, ConfigRepository $configRepository, - EventDispatcherInterface $eventDispatcher + EventDispatcherInterface $eventDispatcher, + Redirect $redirectHelper ) { $this->entityManager = $entityManager; $this->userManager = $userManager; @@ -68,6 +71,7 @@ class ConfigController extends AbstractController $this->annotationRepository = $annotationRepository; $this->configRepository = $configRepository; $this->eventDispatcher = $eventDispatcher; + $this->redirectHelper = $redirectHelper; } /** @@ -654,7 +658,9 @@ class ConfigController extends AbstractController $this->entityManager->persist($user); $this->entityManager->flush(); - return $this->redirect($request->getSession()->get('prevUrl')); + $redirectUrl = $this->redirectHelper->to($request->query->get('redirect')); + + return $this->redirect($redirectUrl); } /** diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index c97ee1f49..7634a3ac8 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; @@ -128,7 +127,7 @@ class EntryController extends AbstractController $this->entityManager->flush(); } - $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl')); + $redirectUrl = $this->redirectHelper->to($request->query->get('redirect')); return $this->redirect($redirectUrl); } @@ -390,7 +389,6 @@ class EntryController extends AbstractController public function viewAction(Entry $entry) { $this->checkUserAction($entry); - $this->get('session')->set('prevUrl', $this->generateUrl('view', ['id' => $entry->getId()])); return $this->render( '@WallabagCore/Entry/entry.html.twig', @@ -452,7 +450,7 @@ class EntryController extends AbstractController $message ); - $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl')); + $redirectUrl = $this->redirectHelper->to($request->query->get('redirect')); return $this->redirect($redirectUrl); } @@ -482,7 +480,7 @@ class EntryController extends AbstractController $message ); - $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl')); + $redirectUrl = $this->redirectHelper->to($request->query->get('redirect')); return $this->redirect($redirectUrl); } @@ -502,8 +500,7 @@ class EntryController extends AbstractController // to avoid redirecting to the deleted entry. Ugh. $url = $this->generateUrl( 'view', - ['id' => $entry->getId()], - UrlGeneratorInterface::ABSOLUTE_PATH + ['id' => $entry->getId()] ); // entry deleted, dispatch event about it! @@ -518,7 +515,7 @@ class EntryController extends AbstractController ); // don't redirect user to the deleted entry (check that the referer doesn't end with the same url) - $prev = $request->getSession()->get('prevUrl', ''); + $prev = $request->query->get('redirect', ''); $to = (1 !== preg_match('#' . $url . '$#i', $prev) ? $prev : null); $redirectUrl = $this->redirectHelper->to($to); @@ -617,7 +614,6 @@ class EntryController extends AbstractController { $searchTerm = (isset($request->get('search_entry')['term']) ? trim($request->get('search_entry')['term']) : ''); $currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : ''); - $request->getSession()->set('prevUrl', $request->getRequestUri()); $formOptions = []; diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index d0e5a5aa6..804512563 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -104,7 +104,7 @@ class TagController extends AbstractController $this->entityManager->flush(); } - $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true); + $redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true); return $this->redirect($redirectUrl); } @@ -185,7 +185,7 @@ class TagController extends AbstractController $form = $this->createForm(RenameTagType::class, new Tag()); $form->handleRequest($request); - $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true); + $redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true); if ($form->isSubmitted() && $form->isValid()) { $newTag = new Tag(); @@ -257,7 +257,7 @@ class TagController extends AbstractController $this->entityManager->flush(); } - return $this->redirect($this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true)); + return $this->redirect($this->redirectHelper->to($request->query->get('redirect'), true)); } /** @@ -279,7 +279,7 @@ class TagController extends AbstractController $this->entityManager->remove($tag); $this->entityManager->flush(); } - $redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true); + $redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true); return $this->redirect($redirectUrl); } diff --git a/src/Wallabag/CoreBundle/Helper/Redirect.php b/src/Wallabag/CoreBundle/Helper/Redirect.php index 99bc192a6..dd0a61a6a 100644 --- a/src/Wallabag/CoreBundle/Helper/Redirect.php +++ b/src/Wallabag/CoreBundle/Helper/Redirect.php @@ -2,6 +2,7 @@ namespace Wallabag\CoreBundle\Helper; +use GuzzleHttp\Psr7\Uri; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Wallabag\CoreBundle\Entity\Config; @@ -23,16 +24,23 @@ class Redirect /** * @param string $url URL to redirect - * @param string $fallback Fallback URL if $url is null * @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read * * @return string */ - public function to($url, $fallback = '', $ignoreActionMarkAsRead = false) + public function to($url, $ignoreActionMarkAsRead = false) { $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; if (!$user instanceof User) { + if (null === $url) { + return $this->router->generate('homepage'); + } + + if (!Uri::isAbsolutePathReference(new Uri($url))) { + return $this->router->generate('homepage'); + } + return $url; } @@ -41,14 +49,14 @@ class Redirect return $this->router->generate('homepage'); } - if (null !== $url) { - return $url; - } - - if ('' === $fallback) { + if (null === $url) { return $this->router->generate('homepage'); } - return $fallback; + if (!Uri::isAbsolutePathReference(new Uri($url))) { + return $this->router->generate('homepage'); + } + + return $url; } } diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/_card_actions.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/_card_actions.html.twig index 26e78215b..d77a48ec0 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Entry/_card_actions.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/_card_actions.html.twig @@ -7,18 +7,20 @@ + {% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %} +