mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-06-13 08:24:47 +02:00
parent
3eae840679
commit
2b9faf46fe
|
@ -759,8 +759,8 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||
public function InSection($sectionName)
|
||||
{
|
||||
$page = Director::get_current_page();
|
||||
while ($page && $page->exists()) {
|
||||
if ($sectionName == $page->URLSegment) {
|
||||
while ($page instanceof SiteTree && $page->exists()) {
|
||||
if ($sectionName === $page->URLSegment) {
|
||||
return true;
|
||||
}
|
||||
$page = $page->Parent();
|
||||
|
|
Loading…
Reference in New Issue
Block a user