]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/InstapaperImport.php
CS
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / InstapaperImport.php
index 7ab69e7a34ab5cffa9dca765060ff0b62c5f0229..44c034f8bcb30262f7c320d72bf3165457bae820 100644 (file)
@@ -72,7 +72,7 @@ class InstapaperImport extends AbstractImport
             // BUT it can also be the status (since status = folder in Instapaper)
             // and we don't want archive, unread & starred to become a tag
             $tags = null;
-            if (false === in_array($data[3], ['Archive', 'Unread', 'Starred'], true)) {
+            if (false === \in_array($data[3], ['Archive', 'Unread', 'Starred'], true)) {
                 $tags = [$data[3]];
             }
 
@@ -105,6 +105,18 @@ class InstapaperImport extends AbstractImport
         return true;
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function validateEntry(array $importedEntry)
+    {
+        if (empty($importedEntry['url'])) {
+            return false;
+        }
+
+        return true;
+    }
+
     /**
      * {@inheritdoc}
      */
@@ -135,7 +147,7 @@ class InstapaperImport extends AbstractImport
             );
         }
 
-        $entry->setArchived($importedEntry['is_archived']);
+        $entry->updateArchived($importedEntry['is_archived']);
         $entry->setStarred($importedEntry['is_starred']);
 
         $this->em->persist($entry);