mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-24 16:40:30 +00:00
Merge pull request #6136 from wallabag/fix/fos-user-3.1
This commit is contained in:
commit
de211be124
30 changed files with 90 additions and 92 deletions
5
.github/dependabot.yml
vendored
5
.github/dependabot.yml
vendored
|
@ -22,15 +22,10 @@ updates:
|
||||||
- j0k3r
|
- j0k3r
|
||||||
- tcitworld
|
- tcitworld
|
||||||
- Kdecherf
|
- Kdecherf
|
||||||
labels:
|
|
||||||
- Ready for review
|
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: doctrine/doctrine-migrations-bundle
|
- dependency-name: doctrine/doctrine-migrations-bundle
|
||||||
versions:
|
versions:
|
||||||
- "> 1.3.2"
|
- "> 1.3.2"
|
||||||
- dependency-name: friendsofsymfony/user-bundle
|
|
||||||
versions:
|
|
||||||
- "> 2.0.2"
|
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
|
|
|
@ -179,8 +179,10 @@ fos_user:
|
||||||
confirmation:
|
confirmation:
|
||||||
enabled: "%fosuser_confirmation%"
|
enabled: "%fosuser_confirmation%"
|
||||||
from_email:
|
from_email:
|
||||||
address: "%from_email%"
|
address: "%from_email%"
|
||||||
sender_name: wallabag
|
sender_name: wallabag
|
||||||
|
service:
|
||||||
|
mailer: fos_user.mailer.twig_swift
|
||||||
|
|
||||||
fos_oauth_server:
|
fos_oauth_server:
|
||||||
db_driver: orm
|
db_driver: orm
|
||||||
|
|
|
@ -34,12 +34,10 @@ security:
|
||||||
provider: fos_userbundle
|
provider: fos_userbundle
|
||||||
|
|
||||||
login_firewall:
|
login_firewall:
|
||||||
logout_on_user_change: true
|
|
||||||
pattern: ^/login$
|
pattern: ^/login$
|
||||||
anonymous: ~
|
anonymous: ~
|
||||||
|
|
||||||
secured_area:
|
secured_area:
|
||||||
logout_on_user_change: true
|
|
||||||
pattern: ^/
|
pattern: ^/
|
||||||
form_login:
|
form_login:
|
||||||
provider: fos_userbundle
|
provider: fos_userbundle
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
"friendsofsymfony/jsrouting-bundle": "^2.2",
|
"friendsofsymfony/jsrouting-bundle": "^2.2",
|
||||||
"friendsofsymfony/oauth-server-bundle": "^1.5",
|
"friendsofsymfony/oauth-server-bundle": "^1.5",
|
||||||
"friendsofsymfony/rest-bundle": "~2.1",
|
"friendsofsymfony/rest-bundle": "~2.1",
|
||||||
"friendsofsymfony/user-bundle": "2.1.*",
|
"friendsofsymfony/user-bundle": "^3.1",
|
||||||
"guzzlehttp/guzzle": "^5.3.1",
|
"guzzlehttp/guzzle": "^5.3.1",
|
||||||
"guzzlehttp/psr7": "^1.8",
|
"guzzlehttp/psr7": "^1.8",
|
||||||
"html2text/html2text": "^4.1",
|
"html2text/html2text": "^4.1",
|
||||||
|
|
76
composer.lock
generated
76
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "56b46a7637ad10cb3e659d390f684c01",
|
"content-hash": "baee037be9102a34e52539f8bafb370d",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "babdev/pagerfanta-bundle",
|
"name": "babdev/pagerfanta-bundle",
|
||||||
|
@ -2621,46 +2621,56 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "friendsofsymfony/user-bundle",
|
"name": "friendsofsymfony/user-bundle",
|
||||||
"version": "v2.1.2",
|
"version": "v3.1.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/FriendsOfSymfony/FOSUserBundle.git",
|
"url": "https://github.com/FriendsOfSymfony/FOSUserBundle.git",
|
||||||
"reference": "1049935edd24ec305cc6cfde1875372fa9600446"
|
"reference": "89c18b6944adb12541f5b3b1ab39287b5336b375"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/1049935edd24ec305cc6cfde1875372fa9600446",
|
"url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/89c18b6944adb12541f5b3b1ab39287b5336b375",
|
||||||
"reference": "1049935edd24ec305cc6cfde1875372fa9600446",
|
"reference": "89c18b6944adb12541f5b3b1ab39287b5336b375",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"paragonie/random_compat": "^1 || ^2",
|
"ext-dom": "*",
|
||||||
"php": "^5.5.9 || ^7.0",
|
"ext-json": "*",
|
||||||
"symfony/form": "^2.8 || ^3.0 || ^4.0",
|
"php": "^7.4 || ^8.0",
|
||||||
"symfony/framework-bundle": "^2.8 || ^3.0 || ^4.0",
|
"symfony/config": "^4.4 || ^5.0 || ^6.0",
|
||||||
"symfony/security-bundle": "^2.8 || ^3.0 || ^4.0",
|
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
|
||||||
"symfony/templating": "^2.8 || ^3.0 || ^4.0",
|
"symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0",
|
||||||
"symfony/twig-bundle": "^2.8 || ^3.0 || ^4.0",
|
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0 || ^3.0",
|
||||||
"symfony/validator": "^2.8 || ^3.0 || ^4.0",
|
"symfony/form": "^4.4 || ^5.0 || ^6.0",
|
||||||
"twig/twig": "^1.28 || ^2.0"
|
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/http-foundation": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/options-resolver": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/routing": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/security-bundle": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/security-core": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/translation": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"symfony/validator": "^4.4 || ^5.0 || ^6.0",
|
||||||
|
"twig/twig": "^1.34 || ^2.4 || ^3.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"doctrine/doctrine-bundle": "<1.3",
|
"doctrine/doctrine-bundle": "<1.3",
|
||||||
"symfony/doctrine-bridge": "<2.7"
|
"doctrine/persistence": "<1.3",
|
||||||
|
"symfony/doctrine-bridge": "<4.4"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/doctrine-bundle": "^1.3",
|
"doctrine/doctrine-bundle": "^1.3 || ^2",
|
||||||
"friendsofphp/php-cs-fixer": "^2.2",
|
"friendsofphp/php-cs-fixer": "^3.0.2, !=3.5.0",
|
||||||
"phpunit/phpunit": "^4.8.35|^5.7.11|^6.5",
|
|
||||||
"swiftmailer/swiftmailer": "^4.3 || ^5.0 || ^6.0",
|
"swiftmailer/swiftmailer": "^4.3 || ^5.0 || ^6.0",
|
||||||
"symfony/console": "^2.8 || ^3.0 || ^4.0",
|
"symfony/console": "^4.4 || ^5.0 || ^6.0",
|
||||||
"symfony/phpunit-bridge": "^2.8 || ^3.0 || ^4.0",
|
"symfony/phpunit-bridge": "^6.1",
|
||||||
"symfony/yaml": "^2.8 || ^3.0 || ^4.0"
|
"symfony/yaml": "^4.4 || ^5.0 || ^6.0"
|
||||||
},
|
},
|
||||||
"type": "symfony-bundle",
|
"type": "symfony-bundle",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "2.1.x-dev"
|
"dev-master": "3.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -2681,11 +2691,11 @@
|
||||||
"email": "stof@notk.org"
|
"email": "stof@notk.org"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "FriendsOfSymfony Community",
|
"name": "Thibault Duplessis"
|
||||||
"homepage": "https://github.com/friendsofsymfony/FOSUserBundle/contributors"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Thibault Duplessis"
|
"name": "FriendsOfSymfony Community",
|
||||||
|
"homepage": "https://github.com/friendsofsymfony/FOSUserBundle/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Symfony FOSUserBundle",
|
"description": "Symfony FOSUserBundle",
|
||||||
|
@ -2696,9 +2706,9 @@
|
||||||
"support": {
|
"support": {
|
||||||
"docs": "https://symfony.com/doc/master/bundles/FOSUserBundle/index.html",
|
"docs": "https://symfony.com/doc/master/bundles/FOSUserBundle/index.html",
|
||||||
"issues": "https://github.com/FriendsOfSymfony/FOSUserBundle/issues",
|
"issues": "https://github.com/FriendsOfSymfony/FOSUserBundle/issues",
|
||||||
"source": "https://github.com/FriendsOfSymfony/FOSUserBundle/tree/v2.1.2"
|
"source": "https://github.com/FriendsOfSymfony/FOSUserBundle/tree/v3.1.0"
|
||||||
},
|
},
|
||||||
"time": "2018-03-08T08:59:27+00:00"
|
"time": "2022-10-26T09:10:52+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "gedmo/doctrine-extensions",
|
"name": "gedmo/doctrine-extensions",
|
||||||
|
@ -4577,16 +4587,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "j0k3r/graby-site-config",
|
"name": "j0k3r/graby-site-config",
|
||||||
"version": "1.0.159",
|
"version": "1.0.160",
|
||||||
"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": "e5bfb9d608f0ce6390d6791ede196c769216ee84"
|
"reference": "17994c315b292e3ff7bcbd0e982a2df849792a55"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/e5bfb9d608f0ce6390d6791ede196c769216ee84",
|
"url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/17994c315b292e3ff7bcbd0e982a2df849792a55",
|
||||||
"reference": "e5bfb9d608f0ce6390d6791ede196c769216ee84",
|
"reference": "17994c315b292e3ff7bcbd0e982a2df849792a55",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -4615,9 +4625,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.159"
|
"source": "https://github.com/j0k3r/graby-site-config/tree/1.0.160"
|
||||||
},
|
},
|
||||||
"time": "2022-11-01T02:53:54+00:00"
|
"time": "2022-12-01T02:33:16+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "j0k3r/httplug-ssrf-plugin",
|
"name": "j0k3r/httplug-ssrf-plugin",
|
||||||
|
|
|
@ -30,11 +30,6 @@ parameters:
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Wallabag/CoreBundle/Controller/StaticController.php
|
path: src/Wallabag/CoreBundle/Controller/StaticController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#"
|
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@ -70,11 +65,6 @@ parameters:
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Wallabag/ImportBundle/Controller/WallabagController.php
|
path: src/Wallabag/ImportBundle/Controller/WallabagController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Wallabag/ImportBundle/DependencyInjection/Configuration.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Scheb\\\\TwoFactorBundle\\\\Model\\\\Email\\\\TwoFactorInterface\\:\\:getName\\(\\)\\.$#"
|
message: "#^Call to an undefined method Scheb\\\\TwoFactorBundle\\\\Model\\\\Email\\\\TwoFactorInterface\\:\\:getName\\(\\)\\.$#"
|
||||||
count: 2
|
count: 2
|
||||||
|
@ -94,3 +84,18 @@ parameters:
|
||||||
message: "#^Property Tests\\\\Wallabag\\\\CoreBundle\\\\Helper\\\\RedirectTest\\:\\:\\$routerMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#"
|
message: "#^Property Tests\\\\Wallabag\\\\CoreBundle\\\\Helper\\\\RedirectTest\\:\\:\\$routerMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch()#"
|
||||||
|
count: 1
|
||||||
|
path: src/Wallabag/ApiBundle/Controller/UserRestController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch()#"
|
||||||
|
count: 1
|
||||||
|
path: src/Wallabag/CoreBundle/Command/InstallCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch()#"
|
||||||
|
count: 1
|
||||||
|
path: src/Wallabag/UserBundle/Controller/ManageController.php
|
||||||
|
|
|
@ -12,9 +12,6 @@ class Configuration implements ConfigurationInterface
|
||||||
*/
|
*/
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
return new TreeBuilder('wallabag_annotation');
|
||||||
$rootNode = $treeBuilder->root('wallabag_annotation');
|
|
||||||
|
|
||||||
return $treeBuilder;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ use JMS\Serializer\SerializerInterface;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use Swagger\Annotations as SWG;
|
use Swagger\Annotations as SWG;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
@ -159,7 +160,7 @@ class UserRestController extends WallabagRestController
|
||||||
|
|
||||||
// dispatch a created event so the associated config will be created
|
// dispatch a created event so the associated config will be created
|
||||||
$event = new UserEvent($user, $request);
|
$event = new UserEvent($user, $request);
|
||||||
$this->get(EventDispatcherInterface::class)->dispatch(FOSUserEvents::USER_CREATED, $event);
|
LegacyEventDispatcherProxy::decorate($this->get(EventDispatcherInterface::class))->dispatch($event, FOSUserEvents::USER_CREATED);
|
||||||
|
|
||||||
return $this->sendUser($user, 'user_api_with_client', JsonResponse::HTTP_CREATED);
|
return $this->sendUser($user, 'user_api_with_client', JsonResponse::HTTP_CREATED);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,6 @@ class Configuration implements ConfigurationInterface
|
||||||
*/
|
*/
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
return new TreeBuilder('wallabag_api');
|
||||||
$rootNode = $treeBuilder->root('wallabag_api');
|
|
||||||
|
|
||||||
return $treeBuilder;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Question\Question;
|
use Symfony\Component\Console\Question\Question;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
|
||||||
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
|
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
|
||||||
use Wallabag\CoreBundle\Entity\InternalSetting;
|
use Wallabag\CoreBundle\Entity\InternalSetting;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
@ -281,7 +282,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||||
|
|
||||||
// dispatch a created event so the associated config will be created
|
// dispatch a created event so the associated config will be created
|
||||||
$event = new UserEvent($user);
|
$event = new UserEvent($user);
|
||||||
$this->getContainer()->get(EventDispatcherInterface::class)->dispatch(FOSUserEvents::USER_CREATED, $event);
|
LegacyEventDispatcherProxy::decorate($this->getContainer()->get(EventDispatcherInterface::class))->dispatch($event, FOSUserEvents::USER_CREATED);
|
||||||
|
|
||||||
$this->io->text('<info>Administration successfully setup.</info>');
|
$this->io->text('<info>Administration successfully setup.</info>');
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ class Configuration implements ConfigurationInterface
|
||||||
{
|
{
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder('wallabag_core');
|
||||||
$rootNode = $treeBuilder->root('wallabag_core');
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
|
|
||||||
$rootNode
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
namespace Wallabag\CoreBundle\Event\Subscriber;
|
namespace Wallabag\CoreBundle\Event\Subscriber;
|
||||||
|
|
||||||
use Doctrine\Bundle\DoctrineBundle\Registry;
|
|
||||||
use Doctrine\Common\EventSubscriber;
|
use Doctrine\Common\EventSubscriber;
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,7 +19,7 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber
|
||||||
{
|
{
|
||||||
private $doctrine;
|
private $doctrine;
|
||||||
|
|
||||||
public function __construct(Registry $doctrine)
|
public function __construct(ManagerRegistry $doctrine)
|
||||||
{
|
{
|
||||||
$this->doctrine = $doctrine;
|
$this->doctrine = $doctrine;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace Wallabag\CoreBundle\Helper;
|
||||||
|
|
||||||
use Graby\Graby;
|
use Graby\Graby;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeExtensionGuesser;
|
use Symfony\Component\Mime\MimeTypes;
|
||||||
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
|
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
|
||||||
use Symfony\Component\Validator\Constraints\Url as UrlConstraint;
|
use Symfony\Component\Validator\Constraints\Url as UrlConstraint;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
@ -22,7 +22,7 @@ class ContentProxy
|
||||||
protected $ignoreOriginProcessor;
|
protected $ignoreOriginProcessor;
|
||||||
protected $validator;
|
protected $validator;
|
||||||
protected $logger;
|
protected $logger;
|
||||||
protected $mimeGuesser;
|
protected $mimeTypes;
|
||||||
protected $fetchingErrorMessage;
|
protected $fetchingErrorMessage;
|
||||||
protected $eventDispatcher;
|
protected $eventDispatcher;
|
||||||
protected $storeArticleHeaders;
|
protected $storeArticleHeaders;
|
||||||
|
@ -34,7 +34,7 @@ class ContentProxy
|
||||||
$this->ignoreOriginProcessor = $ignoreOriginProcessor;
|
$this->ignoreOriginProcessor = $ignoreOriginProcessor;
|
||||||
$this->validator = $validator;
|
$this->validator = $validator;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->mimeGuesser = new MimeTypeExtensionGuesser();
|
$this->mimeTypes = new MimeTypes();
|
||||||
$this->fetchingErrorMessage = $fetchingErrorMessage;
|
$this->fetchingErrorMessage = $fetchingErrorMessage;
|
||||||
$this->storeArticleHeaders = $storeArticleHeaders;
|
$this->storeArticleHeaders = $storeArticleHeaders;
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ class ContentProxy
|
||||||
}
|
}
|
||||||
|
|
||||||
// if content is an image, define it as a preview too
|
// if content is an image, define it as a preview too
|
||||||
if (!empty($content['headers']['content-type']) && \in_array($this->mimeGuesser->guess($content['headers']['content-type']), ['jpeg', 'jpg', 'gif', 'png'], true)) {
|
if (!empty($content['headers']['content-type']) && \in_array(current($this->mimeTypes->getExtensions($content['headers']['content-type'])), ['jpeg', 'jpg', 'gif', 'png'], true)) {
|
||||||
$previewPictureUrl = $content['url'];
|
$previewPictureUrl = $content['url'];
|
||||||
} elseif (empty($previewPictureUrl)) {
|
} elseif (empty($previewPictureUrl)) {
|
||||||
$this->logger->debug('Extracting images from content to provide a default preview picture');
|
$this->logger->debug('Extracting images from content to provide a default preview picture');
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\DomCrawler\Crawler;
|
use Symfony\Component\DomCrawler\Crawler;
|
||||||
use Symfony\Component\Finder\Finder;
|
use Symfony\Component\Finder\Finder;
|
||||||
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeExtensionGuesser;
|
use Symfony\Component\Mime\MimeTypes;
|
||||||
|
|
||||||
class DownloadImages
|
class DownloadImages
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ class DownloadImages
|
||||||
private $client;
|
private $client;
|
||||||
private $baseFolder;
|
private $baseFolder;
|
||||||
private $logger;
|
private $logger;
|
||||||
private $mimeGuesser;
|
private $mimeTypes;
|
||||||
private $wallabagUrl;
|
private $wallabagUrl;
|
||||||
|
|
||||||
public function __construct(HttpClient $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, MessageFactory $messageFactory = null)
|
public function __construct(HttpClient $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, MessageFactory $messageFactory = null)
|
||||||
|
@ -33,7 +33,7 @@ class DownloadImages
|
||||||
$this->baseFolder = $baseFolder;
|
$this->baseFolder = $baseFolder;
|
||||||
$this->wallabagUrl = rtrim($wallabagUrl, '/');
|
$this->wallabagUrl = rtrim($wallabagUrl, '/');
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->mimeGuesser = new MimeTypeExtensionGuesser();
|
$this->mimeTypes = new MimeTypes();
|
||||||
|
|
||||||
$this->setFolder();
|
$this->setFolder();
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ class DownloadImages
|
||||||
*/
|
*/
|
||||||
private function getExtensionFromResponse(ResponseInterface $res, $imagePath)
|
private function getExtensionFromResponse(ResponseInterface $res, $imagePath)
|
||||||
{
|
{
|
||||||
$ext = $this->mimeGuesser->guess(current($res->getHeader('content-type')));
|
$ext = current($this->mimeTypes->getExtensions(current($res->getHeader('content-type'))));
|
||||||
$this->logger->debug('DownloadImages: Checking extension', ['ext' => $ext, 'header' => $res->getHeader('content-type')]);
|
$this->logger->debug('DownloadImages: Checking extension', ['ext' => $ext, 'header' => $res->getHeader('content-type')]);
|
||||||
|
|
||||||
// ok header doesn't have the extension, try a different way
|
// ok header doesn't have the extension, try a different way
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Wallabag\CoreBundle\ParamConverter;
|
namespace Wallabag\CoreBundle\ParamConverter;
|
||||||
|
|
||||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
|
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
|
@ -9,8 +9,8 @@ class Configuration implements ConfigurationInterface
|
||||||
{
|
{
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder('wallabag_import');
|
||||||
$rootNode = $treeBuilder->root('wallabag_import');
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
|
|
||||||
$rootNode
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
|
|
|
@ -11,6 +11,7 @@ use Pagerfanta\Pagerfanta;
|
||||||
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
|
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
|
||||||
use Symfony\Component\Form\Form;
|
use Symfony\Component\Form\Form;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
@ -49,7 +50,7 @@ class ManageController extends Controller
|
||||||
|
|
||||||
// dispatch a created event so the associated config will be created
|
// dispatch a created event so the associated config will be created
|
||||||
$event = new UserEvent($user, $request);
|
$event = new UserEvent($user, $request);
|
||||||
$this->get(EventDispatcherInterface::class)->dispatch(FOSUserEvents::USER_CREATED, $event);
|
LegacyEventDispatcherProxy::decorate($this->get(EventDispatcherInterface::class))->dispatch($event, FOSUserEvents::USER_CREATED);
|
||||||
|
|
||||||
$this->get(SessionInterface::class)->getFlashBag()->add(
|
$this->get(SessionInterface::class)->getFlashBag()->add(
|
||||||
'notice',
|
'notice',
|
||||||
|
|
|
@ -9,9 +9,6 @@ class Configuration implements ConfigurationInterface
|
||||||
{
|
{
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
return new TreeBuilder('wallabag_user');
|
||||||
$rootNode = $treeBuilder->root('wallabag_user');
|
|
||||||
|
|
||||||
return $treeBuilder;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ use Scheb\TwoFactorBundle\Model\BackupCodeInterface;
|
||||||
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface as EmailTwoFactorInterface;
|
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface as EmailTwoFactorInterface;
|
||||||
use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface as GoogleTwoFactorInterface;
|
use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface as GoogleTwoFactorInterface;
|
||||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
|
||||||
use Wallabag\ApiBundle\Entity\Client;
|
use Wallabag\ApiBundle\Entity\Client;
|
||||||
use Wallabag\CoreBundle\Entity\Config;
|
use Wallabag\CoreBundle\Entity\Config;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
@ -205,11 +204,6 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||||
return $this->entries;
|
return $this->entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isEqualTo(UserInterface $user)
|
|
||||||
{
|
|
||||||
return $this->username === $user->getUsername();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set config.
|
* Set config.
|
||||||
*
|
*
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
namespace Tests\Wallabag\CoreBundle\ParamConverter;
|
namespace Tests\Wallabag\CoreBundle\ParamConverter;
|
||||||
|
|
||||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
|
use Doctrine\Persistence\Mapping\ClassMetadata;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
Loading…
Reference in a new issue