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