Skip to content

Commit

Permalink
Merge pull request #567 from spotweb/develop
Browse files Browse the repository at this point in the history
Fix warning in Master when no meta headers are found.
  • Loading branch information
Sweepr committed Jul 17, 2020
2 parents 72d004a + 94090c7 commit 37794f3
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lib/services/NzbHandler/Services_NzbHandler_abs.php
Expand Up @@ -230,18 +230,20 @@ protected function mergeNzbList($nzbList)
$oneNzbFile = simplexml_load_string($nzb['nzb']);

// go through all the head -> meta elements
foreach ($oneNzbFile->head->meta as $meta) {
// check for password type
if ($meta['type'] == 'password') {
// create a meta element with the password as value
$domMeta = $dom->createElement('meta', ''.$meta[0]);
// create attribute: type=password
$domAttribute = $dom->createAttribute('type');
$domAttribute->value = 'password';
// append attribute to meta-element
$domMeta->appendChild($domAttribute);
// append meta-element to head
$domHead->appendChild($domMeta);
if (is_object($oneNzbFile->head->meta)) {
foreach ($oneNzbFile->head->meta as $meta) {
// check for password type
if ($meta['type'] == 'password') {
// create a meta element with the password as value
$domMeta = $dom->createElement('meta', ''.$meta[0]);
// create attribute: type=password
$domAttribute = $dom->createAttribute('type');
$domAttribute->value = 'password';
// append attribute to meta-element
$domMeta->appendChild($domAttribute);
// append meta-element to head
$domHead->appendChild($domMeta);
}
}
}
}
Expand Down

0 comments on commit 37794f3

Please sign in to comment.