Esempio n. 1
0
            header('Content-Type: text/plain; charset=utf-8');
            exit("\n\ngb::\$secret is not set or too short.\n\nPlease edit your gb-config.php file.\n");
        }
    }
    static function verify()
    {
        if (self::verify_integrity() === 2) {
            header("Location: " . gb::$site_url . "gitblog/admin/setup.php");
            exit(0);
        }
        gb::verify_config();
    }
}
#------------------------------------------------------------------------------
# Initialize constants
gb::$dir = dirname(__FILE__);
ini_set('include_path', ini_get('include_path') . ':' . gb::$dir . '/lib');
if (gb::$request_query === 'PATH_INFO') {
    gb::$index_prefix = rtrim(gb::$index_prefix, '/') . '/';
}
$u = dirname($_SERVER['SCRIPT_NAME']);
$s = dirname($_SERVER['SCRIPT_FILENAME']);
if (substr($_SERVER['SCRIPT_FILENAME'], -20) === '/gitblog/gitblog.php') {
    exit('you can not run gitblog.php directly');
}
gb::$is_internal_call = (strpos($s, '/gitblog/') !== false || substr($s, -8) === '/gitblog') && strpos(realpath($s), realpath(gb::$dir)) === 0;
# gb::$site_dir
if (isset($gb_site_dir)) {
    gb::$site_dir = $gb_site_dir;
    unset($gb_site_dir);
} else {