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);
// 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 <dd> contains a description for the bookmark in
// the preceding <dt> node.
$saved = $this->importBookmark($user, $dt, $dd);
if (!empty($dt)) {
// This <dd> contains a description for the bookmark in
// the preceding <dt> node.
$saved = $this->importBookmark($user, $dt, $dd);
}
$dt = null;
$dd = null;