Skip to content

Commit

Permalink
Fix #21 (Direct access protection may cause WSoD)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmb69 committed Jan 30, 2023
1 parent deb09dd commit 337088d
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 18 deletions.
5 changes: 4 additions & 1 deletion admin.php
Expand Up @@ -16,7 +16,10 @@

define('CALENDAR_VERSION', '1.4.10');

if ((!function_exists('sv')) || preg_match('!admin.php!i', sv('PHP_SELF')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

ini_set('display_errors', 0);
error_reporting(0);
Expand Down
5 changes: 4 additions & 1 deletion includes/calendar.php
Expand Up @@ -8,7 +8,10 @@
//=================================================

// Security check
if ((!function_exists('sv')) || preg_match('!calendar/include/calendar.php!i', sv('PHP_SELF')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

global $plugin_cf,$calendar_cf,$plugin_tx,$sl,$sn,$su,$admxx,$lang,$datapath;
$o = '';
Expand Down
6 changes: 4 additions & 2 deletions includes/calendarconfig.php
Expand Up @@ -6,8 +6,10 @@
// //
//======================================================//
// Security check
if ((!function_exists('sv')) || preg_match('!calendar/include/calendarconfig.php!i', sv('PHP_SELF')))die('Access denied');

if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

global $pth,$plugin,$plugin_tx,$calendar_cf,$plugin_cf,$cf,$tx,$sl,$hjs;
$o = $error = $notice = '';
Expand Down
6 changes: 4 additions & 2 deletions includes/editevents.php
Expand Up @@ -9,8 +9,10 @@
//********************************

// Security check
if ((!function_exists('sv')))die('Access denied');

if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

global $plugin_cf,$plugin_tx,$pth,$sl,$plugin,$tx,$lang;
$o = '';
Expand Down
6 changes: 5 additions & 1 deletion includes/eventlist.php
Expand Up @@ -13,7 +13,11 @@
global $plugin_cf,$calendar_cf,$cf,$plugin_tx,$sl,$h,$l,$u,$s,$lang,$datapath;

// Security check
if ((!function_exists('sv')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

$o = "\n\n<!-- CALENDAR EVENT LIST -->\n\n";
$today = date("Ymd");
$day = substr($today, 6);
Expand Down
5 changes: 4 additions & 1 deletion includes/eventlistconfig.php
Expand Up @@ -10,7 +10,10 @@
$o = '';

// Security check
if ((!function_exists('sv')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

//get the button-images
$imageFolder = $pth['folder']['plugins'] . $plugin . "/images";
Expand Down
6 changes: 4 additions & 2 deletions includes/holidayconfig.php
Expand Up @@ -7,8 +7,10 @@
//=====================================================

// Security check
if ((!function_exists('sv')))die('Access denied');

if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

global $pth,$plugin,$plugin_tx,$tx,$sl;
$o = '';
Expand Down
5 changes: 4 additions & 1 deletion includes/loadeventfile.php
Expand Up @@ -7,7 +7,10 @@
global $plugin_cf,$plugin_tx,$pth,$sl,$plugin,$lang,$formatting_hints,$datapath;

// Security check
if ((!function_exists('sv')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

$event_array = array();
// determining which file to read
Expand Down
6 changes: 4 additions & 2 deletions includes/marqueeconfig.php
Expand Up @@ -6,8 +6,10 @@
//
//=====================================================
// Security check
if ((!function_exists('sv')))die('Access denied');

if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

global $pth,$plugin,$plugin_tx,$calendar_cf,$cf,$tx,$sl,$hjs;
$o = '';
Expand Down
5 changes: 4 additions & 1 deletion includes/nextevent.php
Expand Up @@ -9,7 +9,10 @@
global $hjs,$calendar_cf,$plugin_tx,$sl,$lang,$calendar_jqueryplugin,$datapath;

// Security check
if ((!function_exists('sv')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

$now = strtotime('now');

Expand Down
5 changes: 4 additions & 1 deletion includes/presets.php
Expand Up @@ -12,7 +12,10 @@
$css_ok = $lang_ok = $config_ok = FALSE;

// Security check
if ((!function_exists('sv')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

$preset = isset($_POST['preset']) ? $_POST['preset'] : '';
$backup = isset($_POST['backup']) ? $_POST['backup'] : '';
Expand Down
5 changes: 4 additions & 1 deletion includes/readcss.php
@@ -1,7 +1,10 @@
<?php

// Security check
if ((!function_exists('sv')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

//get the css-data
$cssfile = file_get_contents($pth['folder']['plugins'] . $plugin . '/css/stylesheet.css');
Expand Down
5 changes: 4 additions & 1 deletion includes/saveeventfile.php
Expand Up @@ -7,7 +7,10 @@
global $plugin_cf,$plugin_tx,$pth,$sl,$plugin,$lang,$datapath;

// Security check
if ((!function_exists('sv')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

$backups = $plugin_cf['calendar']['backups'];

Expand Down
5 changes: 4 additions & 1 deletion index.php
Expand Up @@ -3,7 +3,10 @@


// Security check
if ((!function_exists('sv')) || preg_match('!calendar/index.php!i', sv('PHP_SELF')))die('Access denied');
if (!defined("CMSIMPLE_XH_VERSION")) {
header("HTTP/1.1 403 Forbidden");
exit;
}

// checking if alternative filepath is wanted
if (!$plugin_cf['calendar']['filepath_data']){$datapath = $pth['folder']['plugins'].$plugin."/content/";}
Expand Down

0 comments on commit 337088d

Please sign in to comment.