fix false check in comic post

This commit is contained in:
John Bintz 2009-11-18 21:54:43 -05:00
parent cd64f57885
commit e90cd16563
2 changed files with 20 additions and 18 deletions

View File

@ -168,6 +168,8 @@ class ComicPressComicPost {
$normalized_children = $this->normalize_ordering($skip_checks); $normalized_children = $this->normalize_ordering($skip_checks);
$attachments_with_children = array();
if (is_array($normalized_children)) {
$remove_from_list = array(); $remove_from_list = array();
foreach ($normalized_children as $id => $info) { foreach ($normalized_children as $id => $info) {
if (isset($info['children'])) { if (isset($info['children'])) {
@ -175,7 +177,6 @@ class ComicPressComicPost {
} }
} }
$attachments_with_children = array();
foreach ($normalized_children as $id => $info) { foreach ($normalized_children as $id => $info) {
if (!in_array($id, $remove_from_list)) { if (!in_array($id, $remove_from_list)) {
if ($info['enabled']) { if ($info['enabled']) {
@ -189,6 +190,7 @@ class ComicPressComicPost {
} }
} }
} }
}
return $attachments_with_children; return $attachments_with_children;
} }

View File

@ -210,7 +210,7 @@ class ComicPressComicPostTest extends PHPUnit_Framework_TestCase {
array('comic' => 'test-1', 'rss' => 'test-3', 'default' => 'test-1'), array('comic' => 'test-1', 'rss' => 'test-3', 'default' => 'test-1'),
) )
), ),
array(false, array())
); );
} }