From 8a21985474c2daae9f84ac52463fe7d297aae3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 20 Nov 2017 17:39:14 +0100 Subject: Added internal setting to enable/disable headers storage --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 6 ++++-- src/Wallabag/CoreBundle/Resources/config/services.yml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 854acb6a..3f5e4760 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -24,8 +24,9 @@ class ContentProxy protected $mimeGuesser; protected $fetchingErrorMessage; protected $eventDispatcher; + protected $storeArticleHeaders; - public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage) + public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders) { $this->graby = $graby; $this->tagger = $tagger; @@ -33,6 +34,7 @@ class ContentProxy $this->logger = $logger; $this->mimeGuesser = new MimeTypeExtensionGuesser(); $this->fetchingErrorMessage = $fetchingErrorMessage; + $this->storeArticleHeaders = $storeArticleHeaders; } /** @@ -185,7 +187,7 @@ class ContentProxy $entry->setPublishedBy($content['authors']); } - if (!empty($content['all_headers'])) { + if (!empty($content['all_headers']) && $this->storeArticleHeaders) { $entry->setHeaders($content['all_headers']); } diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 31b16739..85306276 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -94,6 +94,7 @@ services: - "@validator" - "@logger" - '%wallabag_core.fetching_error_message%' + - '@=service(''craue_config'').get(''store_article_headers'')' wallabag_core.tags_assigner: class: Wallabag\CoreBundle\Helper\TagsAssigner -- cgit v1.2.3 From 709e21a3f4ef3616112a02be06045a1e3ab63a01 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 21 Nov 2017 10:37:36 +0100 Subject: Define storeArticleHeaders false by default Fix tests which must use `$storeArticleHeaders`. Fix CS --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 3f5e4760..4cc20c9c 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -26,7 +26,7 @@ class ContentProxy protected $eventDispatcher; protected $storeArticleHeaders; - public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders) + public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders = false) { $this->graby = $graby; $this->tagger = $tagger; -- cgit v1.2.3