From d5a38c62f47168f9be9ea859aa447636a80bb94a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 31 Mar 2011 16:15:30 -0400 Subject: [PATCH] Don't try to import a
without a
from delicious --- plugins/Bookmark/deliciousbackupimporter.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/Bookmark/deliciousbackupimporter.php b/plugins/Bookmark/deliciousbackupimporter.php index 197c7a143b..7439c8f853 100644 --- a/plugins/Bookmark/deliciousbackupimporter.php +++ b/plugins/Bookmark/deliciousbackupimporter.php @@ -79,6 +79,12 @@ class DeliciousBackupImporter extends QueueHandler $doc = $this->importHTML($body); + // If we can't parse it, it's no good + + if (empty($doc)) { + return true; + } + $dls = $doc->getElementsByTagName('dl'); if ($dls->length != 1) { @@ -112,9 +118,11 @@ class DeliciousBackupImporter extends QueueHandler case 'dd': $dd = $child; - // This
contains a description for the bookmark in - // the preceding
node. - $saved = $this->importBookmark($user, $dt, $dd); + if (!empty($dt)) { + // This
contains a description for the bookmark in + // the preceding
node. + $saved = $this->importBookmark($user, $dt, $dd); + } $dt = null; $dd = null; -- 2.39.5