MINOR FIX: prevents looping over an empty array

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@86166 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2009-09-13 22:25:41 +00:00
parent 966155a054
commit 85ee1007c4

View File

@ -1102,6 +1102,7 @@ JS;
$start = 0;
$pages = DataObject::get("SiteTree", "", "", "", "$start,30");
$count = 0;
if($pages){
while(true) {
foreach($pages as $page) {
if($page && !$page->canPublish()) return Security::permissionFailure($this);
@ -1119,7 +1120,7 @@ JS;
break;
}
}
}
$response .= sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), $count);
} else {