File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
files/redaxo-main/redaxo/src/core Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ require_once rex_path::core('functions/function_rex_globals.php');
9292require_once rex_path::core('functions/function_rex_other.php');
9393
9494// ----------------- VERSION
95- rex::setProperty('version', '5.17.1 ');
95+ rex::setProperty('version', '5.18.0 ');
9696
9797$cacheFile = rex_path::coreCache('config.yml.cache');
9898$configFile = rex_path::coreData('config.yml');
Original file line number Diff line number Diff line change @@ -450,7 +450,16 @@ class rex_be_controller
450450 */
451451 public static function includeCurrentPageSubPath(array $context = [])
452452 {
453- $path = rex_type::string(self::requireCurrentPageObject()->getSubPath());
453+ $page = self::requireCurrentPageObject();
454+ $path = $page->getSubPath();
455+ if (null === $path) {
456+ throw new rex_exception(sprintf(
457+ $page instanceof rex_be_page_main
458+ ? 'Current page "%s" is a main page and therefore has no sub-path.'
459+ : 'Current page "%s" does not have a sub-path.',
460+ $page->getFullKey(),
461+ ));
462+ }
454463
455464 if ('.md' !== strtolower(substr($path, -3))) {
456465 return self::includePath($path, $context);
@@ -471,7 +480,7 @@ class rex_be_controller
471480 $content = $fragment->parse('core/page/docs.php');
472481
473482 $fragment = new rex_fragment();
474- $fragment->setVar('title', self::requireCurrentPageObject() ->getTitle(), false);
483+ $fragment->setVar('title', $page ->getTitle(), false);
475484 $fragment->setVar('body', $content, false);
476485 echo $fragment->parse('core/page/section.php');
477486
You can’t perform that action at this time.
0 commit comments