Merge branch '2.6' into merge-2.6-in-master

This commit is contained in:
Yassine Guedidi 2024-01-03 11:08:10 +01:00
commit 16c239aa78
16 changed files with 149 additions and 114 deletions

View file

@ -1,5 +1,15 @@
# Changelog # 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) ## [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) [Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.6...2.6.7)

View file

@ -1,5 +1,5 @@
wallabag_core: wallabag_core:
version: 2.6.7 version: 2.6.8
paypal_url: "https://liberapay.com/wallabag/donate" paypal_url: "https://liberapay.com/wallabag/donate"
languages: languages:
en: 'English' en: 'English'

96
composer.lock generated
View file

@ -4604,16 +4604,16 @@
}, },
{ {
"name": "j0k3r/graby-site-config", "name": "j0k3r/graby-site-config",
"version": "1.0.180", "version": "1.0.181",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/j0k3r/graby-site-config.git", "url": "https://github.com/j0k3r/graby-site-config.git",
"reference": "4580b0617981210335a79711f14f3415e5ed4ef6" "reference": "c8014aa7aba4142b68c368050b7f785b8ec5cef1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/4580b0617981210335a79711f14f3415e5ed4ef6", "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/c8014aa7aba4142b68c368050b7f785b8ec5cef1",
"reference": "4580b0617981210335a79711f14f3415e5ed4ef6", "reference": "c8014aa7aba4142b68c368050b7f785b8ec5cef1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4642,9 +4642,9 @@
"description": "Graby site config files", "description": "Graby site config files",
"support": { "support": {
"issues": "https://github.com/j0k3r/graby-site-config/issues", "issues": "https://github.com/j0k3r/graby-site-config/issues",
"source": "https://github.com/j0k3r/graby-site-config/tree/1.0.180" "source": "https://github.com/j0k3r/graby-site-config/tree/1.0.181"
}, },
"time": "2023-12-27T21:28:25+00:00" "time": "2024-01-01T02:14:13+00:00"
}, },
{ {
"name": "j0k3r/httplug-ssrf-plugin", "name": "j0k3r/httplug-ssrf-plugin",
@ -7237,16 +7237,16 @@
}, },
{ {
"name": "phpseclib/phpseclib", "name": "phpseclib/phpseclib",
"version": "3.0.34", "version": "3.0.35",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpseclib/phpseclib.git", "url": "https://github.com/phpseclib/phpseclib.git",
"reference": "56c79f16a6ae17e42089c06a2144467acc35348a" "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56c79f16a6ae17e42089c06a2144467acc35348a", "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4b1827beabce71953ca479485c0ae9c51287f2fe",
"reference": "56c79f16a6ae17e42089c06a2144467acc35348a", "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7327,7 +7327,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/phpseclib/phpseclib/issues", "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": [ "funding": [
{ {
@ -7343,7 +7343,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-11-27T11:13:31+00:00" "time": "2023-12-29T01:59:53+00:00"
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
@ -9273,16 +9273,16 @@
}, },
{ {
"name": "symfony/cache", "name": "symfony/cache",
"version": "v5.4.32", "version": "v5.4.34",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/cache.git", "url": "https://github.com/symfony/cache.git",
"reference": "2553faca77502a4f68dc93cd2f3b9ec650751e40" "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/2553faca77502a4f68dc93cd2f3b9ec650751e40", "url": "https://api.github.com/repos/symfony/cache/zipball/b17f28169f7a2f2c0cddf2b044d729f5b75efe5a",
"reference": "2553faca77502a4f68dc93cd2f3b9ec650751e40", "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -9350,7 +9350,7 @@
"psr6" "psr6"
], ],
"support": { "support": {
"source": "https://github.com/symfony/cache/tree/v5.4.32" "source": "https://github.com/symfony/cache/tree/v5.4.34"
}, },
"funding": [ "funding": [
{ {
@ -9366,7 +9366,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-11-24T13:04:07+00:00" "time": "2023-12-18T14:56:06+00:00"
}, },
{ {
"name": "symfony/cache-contracts", "name": "symfony/cache-contracts",
@ -10749,16 +10749,16 @@
}, },
{ {
"name": "symfony/http-client", "name": "symfony/http-client",
"version": "v5.4.31", "version": "v5.4.34",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-client.git", "url": "https://github.com/symfony/http-client.git",
"reference": "6cdf6cdf48101454f014a9ab4e0905f0b902389d" "reference": "8fe833b758bc5b325e9d96a913376d6d57a90fb0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-client/zipball/6cdf6cdf48101454f014a9ab4e0905f0b902389d", "url": "https://api.github.com/repos/symfony/http-client/zipball/8fe833b758bc5b325e9d96a913376d6d57a90fb0",
"reference": "6cdf6cdf48101454f014a9ab4e0905f0b902389d", "reference": "8fe833b758bc5b325e9d96a913376d6d57a90fb0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -10820,7 +10820,7 @@
"http" "http"
], ],
"support": { "support": {
"source": "https://github.com/symfony/http-client/tree/v5.4.31" "source": "https://github.com/symfony/http-client/tree/v5.4.34"
}, },
"funding": [ "funding": [
{ {
@ -10836,7 +10836,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-10-29T12:33:05+00:00" "time": "2023-12-02T08:41:43+00:00"
}, },
{ {
"name": "symfony/http-client-contracts", "name": "symfony/http-client-contracts",
@ -13117,16 +13117,16 @@
}, },
{ {
"name": "symfony/serializer", "name": "symfony/serializer",
"version": "v5.4.33", "version": "v5.4.34",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/serializer.git", "url": "https://github.com/symfony/serializer.git",
"reference": "d751878816665fa3e51c75f01d31c6ee62e94ce5" "reference": "b8353e4208e9161f34d22c4631c63404b26ba929"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/serializer/zipball/d751878816665fa3e51c75f01d31c6ee62e94ce5", "url": "https://api.github.com/repos/symfony/serializer/zipball/b8353e4208e9161f34d22c4631c63404b26ba929",
"reference": "d751878816665fa3e51c75f01d31c6ee62e94ce5", "reference": "b8353e4208e9161f34d22c4631c63404b26ba929",
"shasum": "" "shasum": ""
}, },
"require": { "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.", "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/serializer/tree/v5.4.33" "source": "https://github.com/symfony/serializer/tree/v5.4.34"
}, },
"funding": [ "funding": [
{ {
@ -13216,7 +13216,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-12-01T10:42:49+00:00" "time": "2023-12-27T08:53:17+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
@ -13365,16 +13365,16 @@
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v5.4.32", "version": "v5.4.34",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "91bf4453d65d8231688a04376c3a40efe0770f04" "reference": "e3f98bfc7885c957488f443df82d97814a3ce061"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/91bf4453d65d8231688a04376c3a40efe0770f04", "url": "https://api.github.com/repos/symfony/string/zipball/e3f98bfc7885c957488f443df82d97814a3ce061",
"reference": "91bf4453d65d8231688a04376c3a40efe0770f04", "reference": "e3f98bfc7885c957488f443df82d97814a3ce061",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -13431,7 +13431,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v5.4.32" "source": "https://github.com/symfony/string/tree/v5.4.34"
}, },
"funding": [ "funding": [
{ {
@ -13447,7 +13447,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-11-26T13:43:46+00:00" "time": "2023-12-09T13:20:28+00:00"
}, },
{ {
"name": "symfony/templating", "name": "symfony/templating",
@ -17180,16 +17180,16 @@
}, },
{ {
"name": "symfony/phpunit-bridge", "name": "symfony/phpunit-bridge",
"version": "v6.4.1", "version": "v6.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/phpunit-bridge.git", "url": "https://github.com/symfony/phpunit-bridge.git",
"reference": "cca5373a41d45edbeaf38b7b67f376da2205ff95" "reference": "bd0455b7888e4adac29cf175d819c51f88fed942"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/cca5373a41d45edbeaf38b7b67f376da2205ff95", "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/bd0455b7888e4adac29cf175d819c51f88fed942",
"reference": "cca5373a41d45edbeaf38b7b67f376da2205ff95", "reference": "bd0455b7888e4adac29cf175d819c51f88fed942",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -17241,7 +17241,7 @@
"description": "Provides utilities for PHPUnit, especially user deprecation notices management", "description": "Provides utilities for PHPUnit, especially user deprecation notices management",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.1" "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.2"
}, },
"funding": [ "funding": [
{ {
@ -17257,20 +17257,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-12-01T09:25:07+00:00" "time": "2023-12-19T09:12:31+00:00"
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v5.4.28", "version": "v5.4.34",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b" "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", "url": "https://api.github.com/repos/symfony/process/zipball/8fa22178dfc368911dbd513b431cd9b06f9afe7a",
"reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -17303,7 +17303,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v5.4.28" "source": "https://github.com/symfony/process/tree/v5.4.34"
}, },
"funding": [ "funding": [
{ {
@ -17319,7 +17319,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-08-07T10:36:04+00:00" "time": "2023-12-02T08:41:43+00:00"
}, },
{ {
"name": "symfony/web-profiler-bundle", "name": "symfony/web-profiler-bundle",

View file

@ -34,6 +34,7 @@ use Wallabag\CoreBundle\Form\Type\IgnoreOriginUserRuleType;
use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType; use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType;
use Wallabag\CoreBundle\Form\Type\TaggingRuleType; use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
use Wallabag\CoreBundle\Form\Type\UserInformationType; use Wallabag\CoreBundle\Form\Type\UserInformationType;
use Wallabag\CoreBundle\Helper\Redirect;
use Wallabag\CoreBundle\Repository\ConfigRepository; use Wallabag\CoreBundle\Repository\ConfigRepository;
use Wallabag\CoreBundle\Repository\EntryRepository; use Wallabag\CoreBundle\Repository\EntryRepository;
use Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository; use Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository;
@ -51,6 +52,7 @@ class ConfigController extends AbstractController
private AnnotationRepository $annotationRepository; private AnnotationRepository $annotationRepository;
private ConfigRepository $configRepository; private ConfigRepository $configRepository;
private EventDispatcherInterface $eventDispatcher; private EventDispatcherInterface $eventDispatcher;
private Redirect $redirectHelper;
public function __construct( public function __construct(
EntityManagerInterface $entityManager, EntityManagerInterface $entityManager,
@ -59,7 +61,8 @@ class ConfigController extends AbstractController
TagRepository $tagRepository, TagRepository $tagRepository,
AnnotationRepository $annotationRepository, AnnotationRepository $annotationRepository,
ConfigRepository $configRepository, ConfigRepository $configRepository,
EventDispatcherInterface $eventDispatcher EventDispatcherInterface $eventDispatcher,
Redirect $redirectHelper
) { ) {
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->userManager = $userManager; $this->userManager = $userManager;
@ -68,6 +71,7 @@ class ConfigController extends AbstractController
$this->annotationRepository = $annotationRepository; $this->annotationRepository = $annotationRepository;
$this->configRepository = $configRepository; $this->configRepository = $configRepository;
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
$this->redirectHelper = $redirectHelper;
} }
/** /**
@ -654,7 +658,9 @@ class ConfigController extends AbstractController
$this->entityManager->persist($user); $this->entityManager->persist($user);
$this->entityManager->flush(); $this->entityManager->flush();
return $this->redirect($request->getSession()->get('prevUrl')); $redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
return $this->redirect($redirectUrl);
} }
/** /**

View file

@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Entity\Tag;
@ -128,7 +127,7 @@ class EntryController extends AbstractController
$this->entityManager->flush(); $this->entityManager->flush();
} }
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl')); $redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
return $this->redirect($redirectUrl); return $this->redirect($redirectUrl);
} }
@ -390,7 +389,6 @@ class EntryController extends AbstractController
public function viewAction(Entry $entry) public function viewAction(Entry $entry)
{ {
$this->checkUserAction($entry); $this->checkUserAction($entry);
$this->get('session')->set('prevUrl', $this->generateUrl('view', ['id' => $entry->getId()]));
return $this->render( return $this->render(
'@WallabagCore/Entry/entry.html.twig', '@WallabagCore/Entry/entry.html.twig',
@ -452,7 +450,7 @@ class EntryController extends AbstractController
$message $message
); );
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl')); $redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
return $this->redirect($redirectUrl); return $this->redirect($redirectUrl);
} }
@ -482,7 +480,7 @@ class EntryController extends AbstractController
$message $message
); );
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl')); $redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
return $this->redirect($redirectUrl); return $this->redirect($redirectUrl);
} }
@ -502,8 +500,7 @@ class EntryController extends AbstractController
// to avoid redirecting to the deleted entry. Ugh. // to avoid redirecting to the deleted entry. Ugh.
$url = $this->generateUrl( $url = $this->generateUrl(
'view', 'view',
['id' => $entry->getId()], ['id' => $entry->getId()]
UrlGeneratorInterface::ABSOLUTE_PATH
); );
// entry deleted, dispatch event about it! // 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) // 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); $to = (1 !== preg_match('#' . $url . '$#i', $prev) ? $prev : null);
$redirectUrl = $this->redirectHelper->to($to); $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']) : ''); $searchTerm = (isset($request->get('search_entry')['term']) ? trim($request->get('search_entry')['term']) : '');
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : ''); $currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
$request->getSession()->set('prevUrl', $request->getRequestUri());
$formOptions = []; $formOptions = [];

View file

@ -104,7 +104,7 @@ class TagController extends AbstractController
$this->entityManager->flush(); $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); return $this->redirect($redirectUrl);
} }
@ -185,7 +185,7 @@ class TagController extends AbstractController
$form = $this->createForm(RenameTagType::class, new Tag()); $form = $this->createForm(RenameTagType::class, new Tag());
$form->handleRequest($request); $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()) { if ($form->isSubmitted() && $form->isValid()) {
$newTag = new Tag(); $newTag = new Tag();
@ -257,7 +257,7 @@ class TagController extends AbstractController
$this->entityManager->flush(); $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->remove($tag);
$this->entityManager->flush(); $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); return $this->redirect($redirectUrl);
} }

View file

@ -2,6 +2,7 @@
namespace Wallabag\CoreBundle\Helper; namespace Wallabag\CoreBundle\Helper;
use GuzzleHttp\Psr7\Uri;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Config;
@ -23,16 +24,23 @@ class Redirect
/** /**
* @param string $url URL to 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 * @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
* *
* @return string * @return string
*/ */
public function to($url, $fallback = '', $ignoreActionMarkAsRead = false) public function to($url, $ignoreActionMarkAsRead = false)
{ {
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
if (!$user instanceof User) { 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; return $url;
} }
@ -41,14 +49,14 @@ class Redirect
return $this->router->generate('homepage'); return $this->router->generate('homepage');
} }
if (null !== $url) { if (null === $url) {
return $url;
}
if ('' === $fallback) {
return $this->router->generate('homepage'); return $this->router->generate('homepage');
} }
return $fallback; if (!Uri::isAbsolutePathReference(new Uri($url))) {
return $this->router->generate('homepage');
}
return $url;
} }
} }

View file

@ -7,18 +7,20 @@
</div> </div>
</div> </div>
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
<ul class="tools right"> <ul class="tools right">
<li> <li>
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id}) }}" data-action="same_domain" data-entry-id="{{ entry.id }}"><i class="material-icons">language</i></a> <a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id, redirect: current_path}) }}" data-action="same_domain" data-entry-id="{{ entry.id }}"><i class="material-icons">language</i></a>
</li> </li>
<li> <li>
<a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', {'id': entry.id}) }}" data-action="archived" data-entry-id="{{ entry.id }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a> <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" data-action="archived" data-entry-id="{{ entry.id }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a>
</li> </li>
<li> <li>
<a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', {'id': entry.id}) }}" data-action="star" data-entry-id="{{ entry.id }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a> <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" data-action="star" data-entry-id="{{ entry.id }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
</li> </li>
<li> <li>
<a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" data-action-confirm="{{ 'entry.confirm.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', {'id': entry.id}) }}" data-action="delete" data-entry-id="{{ entry.id }}"><i class="material-icons">delete</i></a> <a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" data-action-confirm="{{ 'entry.confirm.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" data-action="delete" data-entry-id="{{ entry.id }}"><i class="material-icons">delete</i></a>
</li> </li>
</ul> </ul>
</div> </div>

View file

@ -9,12 +9,15 @@
</div> </div>
{% endif %} {% endif %}
{% include "@WallabagCore/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %} {% include "@WallabagCore/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %}
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
<ul class="tools-list hide-on-small-only"> <ul class="tools-list hide-on-small-only">
<li> <li>
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id}) }}"><i class="material-icons">language</i></a> <a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id, redirect: current_path}) }}"><i class="material-icons">language</i></a>
<a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a> <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a>
<a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a> <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
<a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" class="tool grey-text delete" href="{{ path('delete_entry', {'id': entry.id}) }}"><i class="material-icons">delete</i></a> <a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" class="tool grey-text delete" href="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}"><i class="material-icons">delete</i></a>
</li> </li>
</ul> </ul>
</div> </div>

View file

@ -4,7 +4,8 @@
<li class="chip"> <li class="chip">
<a class="chip-label" href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a> <a class="chip-label" href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
{% if withRemove is defined and withRemove == true %} {% if withRemove is defined and withRemove == true %}
<a class="chip-action" href="{{ path('remove_tag', {'entry': entryId, 'tag': tag.id}) }}" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')"> {% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
<a class="chip-action" href="{{ path('remove_tag', {'entry': entryId, 'tag': tag.id, redirect: current_path}) }}" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')">
<i class="material-icons vertical-align-middle">delete</i> <i class="material-icons vertical-align-middle">delete</i>
</a> </a>
{% endif %} {% endif %}

View file

@ -19,18 +19,19 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
{% set list_mode = app.user.config.listMode %} {% set list_mode = app.user.config.listMode %}
{% set entries_with_archived_class_routes = ['tag_entries', 'search', 'all'] %} {% set entries_with_archived_class_routes = ['tag_entries', 'search', 'all'] %}
{% set current_route = app.request.attributes.get('_route') %} {% set current_route = app.request.attributes.get('_route') %}
{% if current_route == 'homepage' %} {% if current_route == 'homepage' %}
{% set current_route = 'unread' %} {% set current_route = 'unread' %}
{% endif %} {% endif %}
<form name="form_mass_action" action="{{ path('mass_action') }}" method="post"> <form name="form_mass_action" action="{{ path('mass_action', {redirect: current_path}) }}" method="post">
<div class="results"> <div class="results">
<div class="nb-results"> <div class="nb-results">
{{ 'entry.list.number_on_the_page'|trans({'%count%': entries.count}) }} {{ 'entry.list.number_on_the_page'|trans({'%count%': entries.count}) }}
{% if entries.count > 0 %} {% if entries.count > 0 %}
<a class="results-item" href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if list_mode == 0 %}view_list{% else %}view_module{% endif %}</i></a> <a class="results-item" href="{{ path('switch_view_mode', {redirect: current_path}) }}"><i class="material-icons">{% if list_mode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
{% endif %} {% endif %}
{% if entries.count > 0 %} {% if entries.count > 0 %}
<label for="mass-action-inputs-displayed" class="mass-action-toggle results-item tooltipped" data-position="right" data-delay="50" data-tooltip="{{ 'entry.list.toggle_mass_action'|trans }}"><i class="material-icons">library_add_check</i></label> <label for="mass-action-inputs-displayed" class="mass-action-toggle results-item tooltipped" data-position="right" data-delay="50" data-tooltip="{{ 'entry.list.toggle_mass_action'|trans }}"><i class="material-icons">library_add_check</i></label>
@ -39,7 +40,7 @@
{% include "@WallabagCore/Entry/_feed_link.html.twig" %} {% include "@WallabagCore/Entry/_feed_link.html.twig" %}
{% endif %} {% endif %}
</div> </div>
{% if current_route == 'search' %}<div><a href="{{ path('tag_this_search', {'filter': searchTerm, 'currentRoute': app.request.get('currentRoute')}) }}" title="{{ 'entry.list.assign_search_tag'|trans }}">{{ 'entry.list.assign_search_tag'|trans }}</a></div>{% endif %} {% if current_route == 'search' %}<div><a href="{{ path('tag_this_search', {'filter': searchTerm, 'currentRoute': app.request.get('currentRoute'), redirect: current_path}) }}" title="{{ 'entry.list.assign_search_tag'|trans }}">{{ 'entry.list.assign_search_tag'|trans }}</a></div>{% endif %}
{% if entries.getNbPages > 1 %} {% if entries.getNbPages > 1 %}
{{ pagerfanta(entries, 'default_wallabag') }} {{ pagerfanta(entries, 'default_wallabag') }}
{% endif %} {% endif %}

View file

@ -4,6 +4,8 @@
{% block body_class %}entry{% endblock %} {% block body_class %}entry{% endblock %}
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
{% block menu %} {% block menu %}
<div class="progress"> <div class="progress">
<div class="determinate"></div> <div class="determinate"></div>
@ -24,12 +26,12 @@
</ul> </ul>
<ul class="right"> <ul class="right">
<li> <li>
<a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_read'|trans }}" href="{{ path('archive_entry', {'id': entry.id}) }}" id="markAsRead"> <a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_read'|trans }}" href="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" id="markAsRead">
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i> <i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
</a> </a>
</li> </li>
<li> <li>
<a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', {'id': entry.id}) }}" id="setFav"> <a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" id="setFav">
<i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i> <i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
</a> </a>
</li> </li>
@ -67,7 +69,7 @@
{% endif %} {% endif %}
<li class="bold hide-on-med-and-down"> <li class="bold hide-on-med-and-down">
<a class="waves-effect collapsible-header markasread" title="{{ mark_as_read_label|trans }}" href="{{ path('archive_entry', {'id': entry.id}) }}" id="markAsRead"> <a class="waves-effect collapsible-header markasread" title="{{ mark_as_read_label|trans }}" href="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" id="markAsRead">
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i> <i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
<span>{{ mark_as_read_label|trans }}</span> <span>{{ mark_as_read_label|trans }}</span>
</a> </a>
@ -75,14 +77,14 @@
</li> </li>
<li class="bold hide-on-med-and-down"> <li class="bold hide-on-med-and-down">
<a class="waves-effect collapsible-header favorite" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', {'id': entry.id}) }}" id="setFav"> <a class="waves-effect collapsible-header favorite" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" id="setFav">
<i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i> <i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
<span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span> <span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
</a> </a>
<div class="collapsible-body"></div> <div class="collapsible-body"></div>
</li> </li>
<li class="bold border-bottom"> <li class="bold border-bottom">
<a class="waves-effect collapsible-header delete" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.delete'|trans }}" href="{{ path('delete_entry', {'id': entry.id}) }}"> <a class="waves-effect collapsible-header delete" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.delete'|trans }}" href="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}">
<i class="material-icons small">delete</i> <i class="material-icons small">delete</i>
<span>{{ 'entry.view.left_menu.delete'|trans }}</span> <span>{{ 'entry.view.left_menu.delete'|trans }}</span>
</a> </a>
@ -297,9 +299,9 @@
<i class="material-icons">menu</i> <i class="material-icons">menu</i>
</a> </a>
<ul> <ul>
<li><a class="btn-floating" href="{{ path('archive_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a></li> <li><a class="btn-floating" href="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a></li>
<li><a class="btn-floating" href="{{ path('star_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i></a></li> <li><a class="btn-floating" href="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i></a></li>
<li><a class="btn-floating" href="{{ path('delete_entry', {'id': entry.id}) }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')"><i class="material-icons">delete</i></a></li> <li><a class="btn-floating" href="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')"><i class="material-icons">delete</i></a></li>
</ul> </ul>
</div> </div>
</div> </div>

View file

@ -3,6 +3,8 @@
{% block title %}{{ 'tag.page_title'|trans }}{% endblock %} {% block title %}{{ 'tag.page_title'|trans }}{% endblock %}
{% block content %} {% block content %}
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
<div class="results clearfix"> <div class="results clearfix">
{{ 'tag.list.number_on_the_page'|trans({'%count%': tags|length}) }} {{ 'tag.list.number_on_the_page'|trans({'%count%': tags|length}) }}
</div> </div>
@ -18,7 +20,7 @@
{{ tag.label }}&nbsp;({{ tag.nbEntries }}) {{ tag.label }}&nbsp;({{ tag.nbEntries }})
</a> </a>
{% if renameForms is defined and renameForms[tag.id] is defined %} {% if renameForms is defined and renameForms[tag.id] is defined %}
<form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug}) }}" method="POST"> <form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug, redirect: current_path}) }}" method="POST">
{{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }} {{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }}
{{ form_rest(renameForms[tag.id]) }} {{ form_rest(renameForms[tag.id]) }}
</form> </form>
@ -26,7 +28,7 @@
<i class="material-icons">mode_edit</i> <i class="material-icons">mode_edit</i>
</a> </a>
{% endif %} {% endif %}
<a id="delete-{{ tag.slug }}" href="{{ path('tag_delete', {'slug': tag.slug}) }}" class="card-tag-icon card-tag-delete" onclick="return confirm('{{ 'tag.confirm.delete'|trans({'%name%': tag.label})|escape('js') }}')"> <a id="delete-{{ tag.slug }}" href="{{ path('tag_delete', {'slug': tag.slug, redirect: current_path}) }}" class="card-tag-icon card-tag-delete" onclick="return confirm('{{ 'tag.confirm.delete'|trans({'%name%': tag.label})|escape('js') }}')">
<i class="material-icons">delete</i> <i class="material-icons">delete</i>
</a> </a>
{% if app.user.config.feedToken %} {% if app.user.config.feedToken %}

View file

@ -1330,8 +1330,10 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->getEntityManager()->flush(); $this->getEntityManager()->flush();
$client->request('GET', '/view/' . $entry->getId()); $crawler = $client->request('GET', '/view/' . $entry->getId());
$client->request('GET', '/archive/' . $entry->getId());
$link = $crawler->filter('a[id="markAsRead"]')->link();
$client->click($link);
$this->assertSame(302, $client->getResponse()->getStatusCode()); $this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertStringContainsString('/view/' . $entry->getId(), $client->getResponse()->headers->get('location')); $this->assertStringContainsString('/view/' . $entry->getId(), $client->getResponse()->headers->get('location'));
@ -1707,7 +1709,7 @@ class EntryControllerTest extends WallabagCoreTestCase
// the deletion link of the first tag // the deletion link of the first tag
$link = $crawler->filter('body div#article div.tools ul.tags li.chip a')->extract(['href'])[1]; $link = $crawler->filter('body div#article div.tools ul.tags li.chip a')->extract(['href'])[1];
$this->assertSame(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link); $this->assertStringStartsWith(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link);
} }
public function testRandom() public function testRandom()

View file

@ -123,9 +123,11 @@ class TagControllerTest extends WallabagCoreTestCase
$this->getEntityManager()->clear(); $this->getEntityManager()->clear();
// We make a first request to set an history and test redirection after tag deletion // We make a first request to set an history and test redirection after tag deletion
$client->request('GET', '/view/' . $entry->getId()); $crawler = $client->request('GET', '/view/' . $entry->getId());
$entryUri = $client->getRequest()->getRequestUri(); $entryUri = $client->getRequest()->getRequestUri();
$client->request('GET', '/remove-tag/' . $entry->getId() . '/' . $tag->getId());
$link = $crawler->filter('a[href^="/remove-tag/' . $entry->getId() . '/' . $tag->getId() . '"]')->link();
$client->click($link);
$this->assertSame(302, $client->getResponse()->getStatusCode()); $this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertSame($entryUri, $client->getResponse()->getTargetUrl()); $this->assertSame($entryUri, $client->getResponse()->getTargetUrl());

View file

@ -34,7 +34,7 @@ class RedirectTest extends TestCase
$this->routerMock->expects($this->any()) $this->routerMock->expects($this->any())
->method('generate') ->method('generate')
->with('homepage') ->with('homepage')
->willReturn('homepage'); ->willReturn('/');
$this->user = new User(); $this->user = new User();
$this->user->setName('youpi'); $this->user->setName('youpi');
@ -60,18 +60,11 @@ class RedirectTest extends TestCase
$this->redirect = new Redirect($this->routerMock, $tokenStorage); $this->redirect = new Redirect($this->routerMock, $tokenStorage);
} }
public function testRedirectToNullWithFallback() public function testRedirectToNull()
{
$redirectUrl = $this->redirect->to(null, 'fallback');
$this->assertSame('fallback', $redirectUrl);
}
public function testRedirectToNullWithoutFallback()
{ {
$redirectUrl = $this->redirect->to(null); $redirectUrl = $this->redirect->to(null);
$this->assertSame($this->routerMock->generate('homepage'), $redirectUrl); $this->assertSame('/', $redirectUrl);
} }
public function testRedirectToValidUrl() public function testRedirectToValidUrl()
@ -81,6 +74,13 @@ class RedirectTest extends TestCase
$this->assertSame('/unread/list', $redirectUrl); $this->assertSame('/unread/list', $redirectUrl);
} }
public function testRedirectToAbsoluteUrl()
{
$redirectUrl = $this->redirect->to('https://www.google.com/');
$this->assertSame('/', $redirectUrl);
}
public function testWithNotLoggedUser() public function testWithNotLoggedUser()
{ {
$redirect = new Redirect($this->routerMock, new TokenStorage()); $redirect = new Redirect($this->routerMock, new TokenStorage());
@ -95,24 +95,24 @@ class RedirectTest extends TestCase
$redirectUrl = $this->redirect->to('/unread/list'); $redirectUrl = $this->redirect->to('/unread/list');
$this->assertSame($this->routerMock->generate('homepage'), $redirectUrl); $this->assertSame('/', $redirectUrl);
} }
public function testUserForRedirectWithIgnoreActionMarkAsRead() public function testUserForRedirectWithIgnoreActionMarkAsRead()
{ {
$this->user->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE); $this->user->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE);
$redirectUrl = $this->redirect->to('/unread/list', '', true); $redirectUrl = $this->redirect->to('/unread/list', true);
$this->assertSame('/unread/list', $redirectUrl); $this->assertSame('/unread/list', $redirectUrl);
} }
public function testUserForRedirectNullWithFallbackWithIgnoreActionMarkAsRead() public function testUserForRedirectNullWithIgnoreActionMarkAsRead()
{ {
$this->user->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE); $this->user->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE);
$redirectUrl = $this->redirect->to(null, 'fallback', true); $redirectUrl = $this->redirect->to(null, true);
$this->assertSame('fallback', $redirectUrl); $this->assertSame('/', $redirectUrl);
} }
} }