Skip to content

Commit

Permalink
Fix custom page
Browse files Browse the repository at this point in the history
  • Loading branch information
partydragen committed Mar 9, 2024
1 parent fe74057 commit 4489221
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/classes/Core/Pages.php
Expand Up @@ -63,7 +63,7 @@ public function add(string $module, string $url, string $file, string $name = ''
public function addCustom(string $url, string $name, bool $widgets = false): void {
$this->_pages[$url] = [
'module' => 'Core',
'file' => 'custom.php',
'file' => 'pages/custom.php',
'name' => $name,
'widgets' => $widgets,
'custom' => true,
Expand Down
5 changes: 4 additions & 1 deletion modules/Core/pages/custom.php
Expand Up @@ -9,8 +9,11 @@
* Custom page
*/

// Check whenever route is homepage or not
$page_route = empty($route) ? Settings::get('default_homepage') : rtrim($route, '/');

// Get page info from URL
$custom_page = DB::getInstance()->get('custom_pages', ['url', rtrim($route, '/')]);
$custom_page = DB::getInstance()->get('custom_pages', ['url', $page_route]);
if (!$custom_page->count()) {
require(ROOT_PATH . '/404.php');
die();
Expand Down

0 comments on commit 4489221

Please sign in to comment.