mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 08:53:37 +01:00
fix PHP 8.0 Fatal error unknown function get_magic_quotes_gpc
This commit is contained in:
parent
dac55616af
commit
ffc048d472
@ -57,7 +57,7 @@ class uiconfig
|
||||
Api\Translation::add_app($_appname);
|
||||
}
|
||||
|
||||
if(get_magic_quotes_gpc() && is_array($_POST['newsettings']))
|
||||
if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() && is_array($_POST['newsettings']))
|
||||
{
|
||||
$_POST['newsettings'] = array_stripslashes($_POST['newsettings']);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class Pam implements Backend
|
||||
{
|
||||
unset($passwd_type); // not used but required by interface
|
||||
|
||||
if (pam_auth($username, get_magic_quotes_gpc() ? stripslashes($passwd) : $passwd))
|
||||
if (pam_auth($username, function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ? stripslashes($passwd) : $passwd))
|
||||
{
|
||||
// for new accounts read full name from password file and pass it to EGroupware
|
||||
if (!$GLOBALS['egw']->accounts->name2id($username) &&
|
||||
|
@ -470,7 +470,7 @@ class Etemplate extends Etemplate\Widget\Template
|
||||
*/
|
||||
static public function process_exec()
|
||||
{
|
||||
if (get_magic_quotes_gpc()) $_POST['value'] = stripslashes($_POST['value']);
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) $_POST['value'] = stripslashes($_POST['value']);
|
||||
$content = json_decode($_POST['value'],true);
|
||||
//error_log(__METHOD__."(".array2string($content).")");
|
||||
|
||||
|
@ -38,7 +38,7 @@ if(!isset($_SESSION['token'])){
|
||||
}
|
||||
|
||||
// slashes
|
||||
if(get_magic_quotes_gpc()){
|
||||
if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()){
|
||||
foreach($_POST as $k => $v){
|
||||
$_POST[$k] = stripslashes($v);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class Request
|
||||
}
|
||||
else
|
||||
{
|
||||
if (get_magic_quotes_gpc()) $input_data = stripslashes($input_data);
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) $input_data = stripslashes($input_data);
|
||||
|
||||
if (($json_data = json_decode($input_data,true)) === null && json_last_error() !== JSON_ERROR_NONE)
|
||||
{
|
||||
|
@ -4421,7 +4421,7 @@ class Mail
|
||||
//if (stripos($_html,'!--[if')!==false && stripos($_html,'<![endif]-->')!==false) Mail\Html::replaceTagsCompletley($_html,'!--\[if','<!\[endif\]-->',false); // Strip out stuff in ifs
|
||||
//error_log(__METHOD__.' ('.__LINE__.') '.$_html);
|
||||
|
||||
if (get_magic_quotes_gpc() === 1) $_html = stripslashes($_html);
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() === 1) $_html = stripslashes($_html);
|
||||
// Strip out doctype in head, as htmlLawed cannot handle it TODO: Consider extracting it and adding it afterwards
|
||||
if (stripos($_html,'!doctype')!==false) Mail\Html::replaceTagsCompletley($_html,'!doctype');
|
||||
if (stripos($_html,'?xml:namespace')!==false) Mail\Html::replaceTagsCompletley($_html,'\?xml:namespace','/>',false);
|
||||
|
@ -17,6 +17,17 @@ use EGroupware\Api;
|
||||
|
||||
require_once dirname(__DIR__).'/autoload.php';
|
||||
|
||||
/**
|
||||
* To ease PHP 8.0 migration
|
||||
*/
|
||||
if (!function_exists('get_magic_quotes_gpc'))
|
||||
{
|
||||
function get_magic_quotes_gpc()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* applies stripslashes recursivly on each element of an array
|
||||
*
|
||||
|
@ -22,7 +22,7 @@ $GLOBALS['egw_info']['flags'] = array(
|
||||
include ('../header.inc.php');
|
||||
|
||||
// strip slashes from _GET parameters, if someone still has magic_quotes_gpc on
|
||||
if (get_magic_quotes_gpc() && $_GET)
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() && $_GET)
|
||||
{
|
||||
$_GET = array_stripslashes($_GET);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class filemanager_select
|
||||
function __construct()
|
||||
{
|
||||
// strip slashes from _GET parameters, if someone still has magic_quotes_gpc on
|
||||
if (get_magic_quotes_gpc() && $_GET)
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() && $_GET)
|
||||
{
|
||||
$_GET = array_stripslashes($_GET);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ class filemanager_ui
|
||||
function __construct()
|
||||
{
|
||||
// strip slashes from _GET parameters, if someone still has magic_quotes_gpc on
|
||||
if (get_magic_quotes_gpc() && $_GET)
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() && $_GET)
|
||||
{
|
||||
$_GET = array_stripslashes($_GET);
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ else
|
||||
{
|
||||
$_SERVER['PHP_AUTH_USER'] = $_SERVER['REMOTE_USER'];
|
||||
}
|
||||
$passwd = get_magic_quotes_gpc() ? stripslashes($_POST['passwd']) : $_POST['passwd'];
|
||||
$passwd = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ? stripslashes($_POST['passwd']) : $_POST['passwd'];
|
||||
$passwd_type = $_POST['passwd_type'];
|
||||
|
||||
// forced password change
|
||||
|
@ -3493,7 +3493,7 @@ class mail_compose
|
||||
|
||||
function stripSlashes($_string)
|
||||
{
|
||||
if (get_magic_quotes_gpc()) {
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
|
||||
return stripslashes($_string);
|
||||
} else {
|
||||
return $_string;
|
||||
|
@ -549,7 +549,7 @@ class mail_zpush implements activesync_plugin_write, activesync_plugin_sendmail,
|
||||
$toCount = 0;
|
||||
//error_log(__METHOD__.__LINE__.array2string($toMailAddr));
|
||||
foreach((array)$toMailAddr as $address) {
|
||||
foreach(Mail::parseAddressList((get_magic_quotes_gpc()?stripslashes($address):$address)) as $addressObject) {
|
||||
foreach(Mail::parseAddressList((function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()?stripslashes($address):$address)) as $addressObject) {
|
||||
$emailAddress = $addressObject->mailbox. ($addressObject->host ? '@'.$addressObject->host : '');
|
||||
if ($ClientSideMeetingRequest === true && $allowSendingInvitations == 'sendifnocalnotif' &&
|
||||
calendar_boupdate::email_update_requested($emailAddress, isset($cSMRMethod) ? $cSMRMethod : 'REQUEST',
|
||||
@ -564,7 +564,7 @@ class mail_zpush implements activesync_plugin_write, activesync_plugin_sendmail,
|
||||
}
|
||||
$ccCount = 0;
|
||||
foreach((array)$ccMailAddr as $address) {
|
||||
foreach(Mail::parseAddressList((get_magic_quotes_gpc()?stripslashes($address):$address)) as $addressObject) {
|
||||
foreach(Mail::parseAddressList((function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()?stripslashes($address):$address)) as $addressObject) {
|
||||
$emailAddress = $addressObject->mailbox. ($addressObject->host ? '@'.$addressObject->host : '');
|
||||
if ($ClientSideMeetingRequest === true && $allowSendingInvitations == 'sendifnocalnotif' && calendar_boupdate::email_update_requested($emailAddress)) continue;
|
||||
$mailObject->AddCC($emailAddress, $addressObject->personal);
|
||||
@ -573,7 +573,7 @@ class mail_zpush implements activesync_plugin_write, activesync_plugin_sendmail,
|
||||
}
|
||||
$bccCount = 0;
|
||||
foreach((array)$bccMailAddr as $address) {
|
||||
foreach(Mail::parseAddressList((get_magic_quotes_gpc()?stripslashes($address):$address)) as $addressObject) {
|
||||
foreach(Mail::parseAddressList((function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()?stripslashes($address):$address)) as $addressObject) {
|
||||
$emailAddress = $addressObject->mailbox. ($addressObject->host ? '@'.$addressObject->host : '');
|
||||
if ($ClientSideMeetingRequest === true && $allowSendingInvitations == 'sendifnocalnotif' && calendar_boupdate::email_update_requested($emailAddress)) continue;
|
||||
$mailObject->AddBCC($emailAddress, $addressObject->personal);
|
||||
@ -800,7 +800,7 @@ class mail_zpush implements activesync_plugin_write, activesync_plugin_sendmail,
|
||||
}
|
||||
if (count($folderArray) > 0) {
|
||||
foreach((array)$bccMailAddr as $address) {
|
||||
foreach(Mail::parseAddressList((get_magic_quotes_gpc()?stripslashes($address):$address)) as $addressObject) {
|
||||
foreach(Mail::parseAddressList((function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()?stripslashes($address):$address)) as $addressObject) {
|
||||
$emailAddress = $addressObject->mailbox. ($addressObject->host ? '@'.$addressObject->host : '');
|
||||
$mailAddr[] = array($emailAddress, $addressObject->personal);
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ function check_header_form()
|
||||
// setting the non-domain settings from the posted content
|
||||
foreach($_POST['setting'] as $name => $value)
|
||||
{
|
||||
if (get_magic_quotes_gpc()) $value = stripslashes($value);
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) $value = stripslashes($value);
|
||||
|
||||
switch($name)
|
||||
{
|
||||
@ -191,7 +191,7 @@ function check_header_form()
|
||||
|
||||
foreach($_POST['setting_'.$key] as $name => $value)
|
||||
{
|
||||
if (get_magic_quotes_gpc()) $value = stripslashes($value);
|
||||
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) $value = stripslashes($value);
|
||||
|
||||
if ($name == 'new_config_passwd')
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user