mirror of
https://github.com/wallabag/wallabag.git
synced 2025-04-27 12:14:42 +00:00
updateOriginUrl: rewrite some if, resolving feedbacks from PR
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
b49c87acf1
commit
5ba5e22a09
1 changed files with 36 additions and 33 deletions
|
@ -321,7 +321,10 @@ class ContentProxy
|
|||
*/
|
||||
private function updateOriginUrl(Entry $entry, $url)
|
||||
{
|
||||
if (!empty($url) && $entry->getUrl() !== $url) {
|
||||
if (empty($url) || $entry->getUrl() === $url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parsed_entry_url = parse_url($entry->getUrl());
|
||||
$parsed_content_url = parse_url($url);
|
||||
|
||||
|
@ -334,7 +337,9 @@ class ContentProxy
|
|||
|
||||
if ($this->ignoreUrl($entry->getUrl())) {
|
||||
$entry->setUrl($url);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ($diff_keys) {
|
||||
case ['path']:
|
||||
if (($parsed_entry_url['path'] . '/' === $parsed_content_url['path']) // diff is trailing slash, we only replace the url of the entry
|
||||
|
@ -358,8 +363,6 @@ class ContentProxy
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check entry url against an ignore list to replace with content url.
|
||||
|
|
Loading…
Reference in a new issue