From 95743ebacf4eb7c607ddbd8ecbb4e52dfe303a8c Mon Sep 17 00:00:00 2001
From: JamesRezo <james@rezo.net>
Date: Sat, 2 Apr 2022 13:53:59 +0200
Subject: [PATCH] =?UTF-8?q?chore:=20#4881=20suppression=20de=20la=20global?=
 =?UTF-8?q?e=20flag=5Fsapi=5Fname,=20la=20fonction=20php=5Fsapi=5Fname()?=
 =?UTF-8?q?=20=C3=A9tant=20toujours=20pr=C3=A9sente=20depuis=20PHP4.0.1=20?=
 =?UTF-8?q?(juin=202000)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/inc/utils.php        | 1 -
 prive/formulaires/login.php | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php
index a7f40214a4..24eac74248 100644
--- a/ecrire/inc/utils.php
+++ b/ecrire/inc/utils.php
@@ -2725,7 +2725,6 @@ function spip_initialisation_core($pi = null, $pa = null, $ti = null, $ta = null
 	$GLOBALS['flag_ob'] = (function_exists('ob_start')
 		&& function_exists('ini_get')
 		&& !strstr(@ini_get('disable_functions'), 'ob_'));
-	$GLOBALS['flag_sapi_name'] = function_exists('php_sapi_name');
 	$GLOBALS['flag_get_cfg_var'] = (@get_cfg_var('error_reporting') != '');
 	$GLOBALS['flag_upload'] = (!$GLOBALS['flag_get_cfg_var'] ||
 		(get_cfg_var('upload_max_filesize') > 0));
diff --git a/prive/formulaires/login.php b/prive/formulaires/login.php
index 49b8b07df5..4cf1551f06 100644
--- a/prive/formulaires/login.php
+++ b/prive/formulaires/login.php
@@ -183,7 +183,7 @@ function login_auth_http() {
 		!$GLOBALS['ignore_auth_http']
 		and _request('var_erreur') == 'cookie'
 		and (!isset($_COOKIE['spip_session']) or $_COOKIE['spip_session'] != 'test_echec_cookie')
-		and (($GLOBALS['flag_sapi_name'] and preg_match(',apache,i', @php_sapi_name()))
+		and (preg_match(',apache,i', php_sapi_name())
 			or preg_match(',^Apache.* PHP,', $_SERVER['SERVER_SOFTWARE']))
 		// Attention dans le cas 'intranet' la proposition de se loger
 		// par auth_http peut conduire a l'echec.
-- 
GitLab