X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FPocketImport.php;h=a39d81568664144a1bf503ff27b80b2537094a6e;hb=92a66835624acf6fd14f5adc5f8aab399658592e;hp=4b1ad1d7565bc0b3a9dfbb537a7c1262ab57adad;hpb=2b6380f5acaecaa7aa04c12d7bf4fd7c84b60b08;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 4b1ad1d7..a39d8156 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -168,6 +168,18 @@ class PocketImport extends AbstractImport $this->client = $client; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['resolved_url']) && empty($importedEntry['given_url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} * @@ -194,10 +206,10 @@ class PocketImport extends AbstractImport $this->fetchContent($entry, $url); // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted - $entry->updateArchived(1 === $importedEntry['status'] || $this->markAsRead); + $entry->updateArchived(1 === (int) $importedEntry['status'] || $this->markAsRead); - // 0 or 1 - 1 If the item is starred - $entry->setStarred(1 === $importedEntry['favorite']); + // 0 or 1 - 1 if the item is starred + $entry->setStarred(1 === (int) $importedEntry['favorite']); $title = 'Untitled'; if (isset($importedEntry['resolved_title']) && '' !== $importedEntry['resolved_title']) {