X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FInstapaperImport.php;h=60da77519936196e5358f5c82438633f7316c46c;hb=refs%2Fheads%2Fphp73;hp=7ab69e7a34ab5cffa9dca765060ff0b62c5f0229;hpb=1953a872932a63792293b4aec087880265ba89f7;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 7ab69e7a..60da7751 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -62,17 +62,17 @@ class InstapaperImport extends AbstractImport } $entries = []; - $handle = fopen($this->filepath, 'r'); + $handle = fopen($this->filepath, 'rb'); while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { - continue; + break; } // last element in the csv is the folder where the content belong // 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]]; } @@ -135,7 +135,7 @@ class InstapaperImport extends AbstractImport ); } - $entry->setArchived($importedEntry['is_archived']); + $entry->updateArchived($importedEntry['is_archived']); $entry->setStarred($importedEntry['is_starred']); $this->em->persist($entry);