Uncaught Error

Undefined constant "host"

(File: /home/gumdum/public_html/core/init.php)

http://bucketlistmap.com/


File: /home/gumdum/public_html/core/init.php

    // Friendly URLs?
    define('FRIENDLY_URLS', Config::get('core.friendly') == 'true');

    // Set up cache
    $cache = new Cache(['name' => 'nameless', 'extension' => '.cache', 'path' => ROOT_PATH . '/cache/']);

    // Force https/www?
    if (Config::get('core.force_https')) {
        define('FORCE_SSL', true);
    }
    if (Config::get('core.force_www')) {
        define('FORCE_WWW', true);
    }

    $host = HttpUtils::getHeader('Host');
    // Only check force HTTPS and force www. when Host header is set
    // These options don't make sense when making requests to IP addresses anyway
    if ($host !== null) {
        if (defined('FORCE_SSL') && HttpUtils::getProtocol() === 'http') {
            if (defined('FORCE_WWW') && !str_contains(host, 'www.')) {
                Redirect::to('https://www.' . $host . $_SERVER['REQUEST_URI']);
            } else {
                Redirect::to('https://.' . $host . $_SERVER['REQUEST_URI']);
            }
        } else if (defined('FORCE_WWW') && !str_contains($host, 'www.')) {
            Redirect::to(HttpUtils::getProtocol() . '://www.' . $host . $_SERVER['REQUEST_URI']);
        }
    }

    // Ensure database is up-to-date
    PhinxAdapter::ensureUpToDate();

    // Error reporting
    if (!defined('DEBUGGING')) {
        if (Util::getSetting('error_reporting') === '1') {
            ini_set('display_startup_errors', 1);
            ini_set('display_errors', 1);
            error_reporting(-1);
            define('DEBUGGING', 1);
        } else {
File: /home/gumdum/public_html/index.php
if (!ini_get('upload_tmp_dir')) {
    $tmp_dir = sys_get_temp_dir();
} else {
    $tmp_dir = ini_get('upload_tmp_dir');
}

if (HttpUtils::getProtocol() === 'https') {
    ini_set('session.cookie_secure', 'On');
}

ini_set('session.cookie_httponly', 1);
ini_set('open_basedir', ROOT_PATH . PATH_SEPARATOR . $tmp_dir . PATH_SEPARATOR . '/proc/stat');

// Get the directory the user is trying to access
$directory = $_SERVER['REQUEST_URI'];
$directories = explode('/', $directory);
$lim = count($directories);


// Start initialising the page
require(ROOT_PATH . '/core/init.php');

// Get page to load from URL
if (!isset($_GET['route']) || $_GET['route'] == '/') {
    if (((!isset($_GET['route']) || ($_GET['route'] != '/')) && count($directories) > 1)) {
        require(ROOT_PATH . '/404.php');
    } else {
        // Homepage
        $pages->setActivePage($pages->getPageByURL('/'));
        require(ROOT_PATH . '/modules/Core/pages/index.php');
    }
    die();
}

$route = rtrim(strtok($_GET['route'], '?'), '/');

$all_pages = $pages->returnPages();

if (array_key_exists($route, $all_pages)) {
    $pages->setActivePage($all_pages[$route]);
    if (isset($all_pages[$route]['custom'])) {