Don't try to import a <dd> without a <dt> from delicious

This commit is contained in:
Evan Prodromou 2011-03-31 16:15:30 -04:00
parent f580147058
commit d5a38c62f4
1 changed files with 11 additions and 3 deletions

View File

@ -79,6 +79,12 @@ class DeliciousBackupImporter extends QueueHandler
$doc = $this->importHTML($body); $doc = $this->importHTML($body);
// If we can't parse it, it's no good
if (empty($doc)) {
return true;
}
$dls = $doc->getElementsByTagName('dl'); $dls = $doc->getElementsByTagName('dl');
if ($dls->length != 1) { if ($dls->length != 1) {
@ -112,9 +118,11 @@ class DeliciousBackupImporter extends QueueHandler
case 'dd': case 'dd':
$dd = $child; $dd = $child;
// This <dd> contains a description for the bookmark in if (!empty($dt)) {
// the preceding <dt> node. // This <dd> contains a description for the bookmark in
$saved = $this->importBookmark($user, $dt, $dd); // the preceding <dt> node.
$saved = $this->importBookmark($user, $dt, $dd);
}
$dt = null; $dt = null;
$dd = null; $dd = null;