Skip to content

Commit

Permalink
Fix #14: get_magic_quotes_gpc() is removed as of PHP 8.0.0
Browse files Browse the repository at this point in the history
Since the plugin currently might still support PHP 5.3, we need to
support the dreaded magic_quotes, so we work around by checking if
the function is defined.
  • Loading branch information
cmb69 committed Aug 9, 2022
1 parent a1a47ce commit df46869
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion admin.php
Expand Up @@ -864,7 +864,7 @@ function sourceView($file,$template=0)
$action = isset($_POST['action']) ? $_POST['action'] : '';
$savedfile = isset($_POST['file']) ? $_POST['file'] : '';
$data = isset($_POST['data']) ? $_POST['data'] : '';
if(get_magic_quotes_gpc()) $data = stripslashes($data);
if(function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) $data = stripslashes($data);
$data = str_replace('¬','­',$data);

// check if the new filename has unwanted characters
Expand Down
2 changes: 1 addition & 1 deletion includes/calendarconfig.php
Expand Up @@ -132,7 +132,7 @@
// css-values
//=============
$nowrapdata = $nowrap? 'nowrap' : 'normal';
if(get_magic_quotes_gpc()) {
if(function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
$headlineconfig = "\n" . trim(stripslashes($headlineconfig)) . "\n";
$daynameconfig = "\n" . trim(stripslashes($daynameconfig)) . "\n";
$todaynameconfig = "\n" . trim(stripslashes($todaynameconfig)) . "\n";
Expand Down
2 changes: 1 addition & 1 deletion includes/eventlistconfig.php
Expand Up @@ -68,7 +68,7 @@
$monthfontsize = isset($_POST['monthfontsize']) ? $_POST['monthfontsize'] : $monthfontsize;
$eventfontweight = isset($_POST['eventfontweight']) ? $_POST['eventfontweight'] : $eventfontweight;

if(get_magic_quotes_gpc()) $eventlistpage = stripslashes($eventlistpage);
if(function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) $eventlistpage = stripslashes($eventlistpage);

if ($config == "config"){

Expand Down

0 comments on commit df46869

Please sign in to comment.