aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-11-21 13:26:24 +0100
committerGitHub <noreply@github.com>2017-11-21 13:26:24 +0100
commit95b7d92ea5f92078c2e1fed0b346a9722de762c4 (patch)
tree3e9ed92170e9e63b592ef47abfd4c05f6374b76a /src
parentfb258aeef0a28ce9aaebac8f337b9970bd99e70d (diff)
parent709e21a3f4ef3616112a02be06045a1e3ab63a01 (diff)
downloadwallabag-95b7d92ea5f92078c2e1fed0b346a9722de762c4.tar.gz
wallabag-95b7d92ea5f92078c2e1fed0b346a9722de762c4.tar.zst
wallabag-95b7d92ea5f92078c2e1fed0b346a9722de762c4.zip
Merge pull request #3425 from wallabag/add-setting-for-headers
Added internal setting to enable/disable headers storage
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php6
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml1
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 854acb6a..4cc20c9c 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -24,8 +24,9 @@ class ContentProxy
24 protected $mimeGuesser; 24 protected $mimeGuesser;
25 protected $fetchingErrorMessage; 25 protected $fetchingErrorMessage;
26 protected $eventDispatcher; 26 protected $eventDispatcher;
27 protected $storeArticleHeaders;
27 28
28 public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage) 29 public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders = false)
29 { 30 {
30 $this->graby = $graby; 31 $this->graby = $graby;
31 $this->tagger = $tagger; 32 $this->tagger = $tagger;
@@ -33,6 +34,7 @@ class ContentProxy
33 $this->logger = $logger; 34 $this->logger = $logger;
34 $this->mimeGuesser = new MimeTypeExtensionGuesser(); 35 $this->mimeGuesser = new MimeTypeExtensionGuesser();
35 $this->fetchingErrorMessage = $fetchingErrorMessage; 36 $this->fetchingErrorMessage = $fetchingErrorMessage;
37 $this->storeArticleHeaders = $storeArticleHeaders;
36 } 38 }
37 39
38 /** 40 /**
@@ -185,7 +187,7 @@ class ContentProxy
185 $entry->setPublishedBy($content['authors']); 187 $entry->setPublishedBy($content['authors']);
186 } 188 }
187 189
188 if (!empty($content['all_headers'])) { 190 if (!empty($content['all_headers']) && $this->storeArticleHeaders) {
189 $entry->setHeaders($content['all_headers']); 191 $entry->setHeaders($content['all_headers']);
190 } 192 }
191 193
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:
94 - "@validator" 94 - "@validator"
95 - "@logger" 95 - "@logger"
96 - '%wallabag_core.fetching_error_message%' 96 - '%wallabag_core.fetching_error_message%'
97 - '@=service(''craue_config'').get(''store_article_headers'')'
97 98
98 wallabag_core.tags_assigner: 99 wallabag_core.tags_assigner:
99 class: Wallabag\CoreBundle\Helper\TagsAssigner 100 class: Wallabag\CoreBundle\Helper\TagsAssigner