Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Update loader.php
Browse files Browse the repository at this point in the history
  • Loading branch information
masterking32 committed Dec 28, 2023
1 parent fc82b50 commit b25709a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 37 deletions.
68 changes: 33 additions & 35 deletions application/loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,34 @@

use voku\helper\AntiXSS;

header('X-Powered-Framework: MasterkinG-Framework');
header('X-Powered-CMS: MasterkinG-CMS');

ob_start();
header('X-Powered-Framework:MasterkinG-Framework');
header('X-Powered-CMS:MasterkinG-CMS');
session_start();
define('base_path', str_replace('application/loader.php', '', str_replace("\\", '/', __FILE__)));
define('app_path', str_replace('application/loader.php', '', str_replace("\\", '/', __FILE__)) . 'application/');
require_once app_path . 'vendor/autoload.php';

define('base_path', str_replace('application/loader.php', '', __FILE__));
define('app_path', base_path . 'application/');

require app_path . 'vendor/autoload.php';
require_once app_path . 'config/config.php';
require_once app_path . 'include/core_handler.php';
require_once app_path . 'include/functions.php';

/* Configuration check */
if(!get_config('disable_changepassword') && get_config('soap_for_register'))
{
$config['disable_changepassword'] = true;
if (!get_config('disable_changepassword') && get_config('soap_for_register')) {
$config['disable_changepassword'] = true;
}

if (get_config('debug_mode')) {
@error_reporting(-1);
@ini_set('display_errors', 1);
error_reporting(-1);
ini_set('display_errors', 1);
} else {
@ini_set('display_errors', 0);
ini_set('display_errors', 0);
if (version_compare(PHP_VERSION, '5.3', '>=')) {
@error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
} else {
@error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
}

Expand All @@ -42,44 +44,40 @@
require_once app_path . 'include/vote.php';
require_once app_path . 'include/status.php';

if (!preg_match('/^([a-z-]+)$/i', strtolower(get_config('language'))) || !file_exists(app_path . 'language/' . strtolower(get_config('language')) . '.php')) {
die('Language is not valid!');
}
$language = strtolower(get_config('language'));
$languageFile = app_path . 'language/' . $language . '.php';

if(!empty($_COOKIE['website_lang']) && !empty($config['supported_langs'][$_COOKIE['website_lang']]) && file_exists(app_path . 'language/' . strtolower($_COOKIE['website_lang']) . '.php'))
{
require_once app_path . 'language/' . strtolower($_COOKIE['website_lang']) . '.php';
}else{
require_once app_path . 'language/' . strtolower(get_config('language')) . '.php';
if (!preg_match('/^([a-z-]+)$/i', $language) || !file_exists($languageFile)) {
exit('Language is not valid!');
}


if (!empty($_COOKIE['website_lang']) && !empty($config['supported_langs'][$_COOKIE['website_lang']]) && file_exists(app_path . 'language/' . strtolower($_COOKIE['website_lang']) . '.php')) {
require_once app_path . 'language/' . strtolower($_COOKIE['website_lang']) . '.php';
} else {
require_once $languageFile;
}

$antiXss = new AntiXSS();

if (!empty(get_config('script_version'))) {
/* @TODO Add online version check! */
if (version_compare(get_config('script_version'), '2.0.2', '<')) {
echo 'Use last version of config.php file.';
exit();
exit('Use last version of config.php file.');
}
} else {
echo 'Use last version of config.php file.';
exit();
exit('Use last version of config.php file.');
}

if ($config['srp6_support'] == true && !extension_loaded('gmp')) {
echo 'Please enable GMP in your php.ini';
exit();
if ($config['srp6_support'] && !extension_loaded('gmp')) {
exit('Please enable GMP in your php.ini');
}

if ($config['captcha_type'] == 0 && !extension_loaded('gd')) {
echo 'Please enable gd or gd2 in your php.ini';
exit();
exit('Please enable gd or gd2 in your php.ini');
}

if ($config['soap_for_register'] == true && !extension_loaded('soap')) {
echo 'Please enable SOAP in your php.ini';
exit();
if ($config['soap_for_register'] && !extension_loaded('soap')) {
exit('Please enable SOAP in your php.ini');
}

database::db_connect();
database::db_connect();
3 changes: 1 addition & 2 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php
/**
* @author Amin Mahmoudi (MasterkinG)
* @copyright Copyright (c) 2019 - 2024, MasterkinG32 Team, Inc. (https://masterking32.com)
* @copyright Copyright (c) 2019 - 2024, MasterkinG32 (https://masterking32.com)
* @link https://masterking32.com
* @Description : It's not masterking32 framework !
**/

$osType = PHP_OS;
Expand Down

0 comments on commit b25709a

Please sign in to comment.