diff options
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/ContentProxy.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 19fcbfbf..c7ccfe4a 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -67,9 +67,8 @@ class ContentProxy | |||
67 | 67 | ||
68 | // In one case (at least in tests), url is empty here | 68 | // In one case (at least in tests), url is empty here |
69 | // so we set it using $url provided in the updateEntry call. | 69 | // so we set it using $url provided in the updateEntry call. |
70 | // Not sure what are the other possible cases where this property is empty | 70 | // Not sure what are the other possible cases where this property is empty |
71 | if (empty($entry->getUrl()) && !empty($url)) | 71 | if (empty($entry->getUrl()) && !empty($url)) { |
72 | { | ||
73 | $entry->setUrl($url); | 72 | $entry->setUrl($url); |
74 | } | 73 | } |
75 | 74 | ||
@@ -193,7 +192,15 @@ class ContentProxy | |||
193 | */ | 192 | */ |
194 | private function stockEntry(Entry $entry, array $content) | 193 | private function stockEntry(Entry $entry, array $content) |
195 | { | 194 | { |
196 | $entry->setUrl($content['url']); | 195 | // When a redirection occurs while fetching an entry |
196 | // we move the original url in origin_url property if empty | ||
197 | // and set the entry url with the final value | ||
198 | if (!empty($content['url']) && $entry->getUrl() !== $content['url']) { | ||
199 | if (empty($entry->getOriginUrl())) { | ||
200 | $entry->setOriginUrl($entry->getUrl()); | ||
201 | } | ||
202 | $entry->setUrl($content['url']); | ||
203 | } | ||
197 | 204 | ||
198 | $this->setEntryDomainName($entry); | 205 | $this->setEntryDomainName($entry); |
199 | 206 | ||