Skip to content
Extraits de code Groupes Projets
Valider 15390a23 rédigé par marcimat's avatar marcimat
Parcourir les fichiers

Ticket #4060 : Nettoyage de code PHP < 5.4.

parent faf2b372
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -683,9 +683,7 @@ function entites_html($texte, $tout = false, $quote = true) {
}
include_spip('inc/texte');
$flags = ($quote ? ENT_QUOTES : ENT_NOQUOTES);
if (defined('ENT_HTML401')) {
$flags |= ENT_HTML401;
}
$flags |= ENT_HTML401;
$texte = spip_htmlspecialchars(echappe_retour(echappe_html($texte, '', true), '', 'proteger_amp'), $flags);
if ($tout) {
return corriger_toutes_entites_html($texte);
......
......@@ -212,10 +212,7 @@ function abs_url($texte, $base = '') {
*/
function spip_htmlspecialchars($string, $flags = null, $encoding = 'ISO-8859-1', $double_encode = true) {
if (is_null($flags)) {
$flags = ENT_COMPAT;
if (defined('ENT_HTML401')) {
$flags |= ENT_HTML401;
}
$flags = ENT_COMPAT|ENT_HTML401;
}
return htmlspecialchars($string, $flags, $encoding, $double_encode);
......@@ -232,10 +229,7 @@ function spip_htmlspecialchars($string, $flags = null, $encoding = 'ISO-8859-1',
*/
function spip_htmlentities($string, $flags = null, $encoding = 'ISO-8859-1', $double_encode = true) {
if (is_null($flags)) {
$flags = ENT_COMPAT;
if (defined('ENT_HTML401')) {
$flags |= ENT_HTML401;
}
$flags = ENT_COMPAT|ENT_HTML401;
}
return htmlentities($string, $flags, $encoding, $double_encode);
......
......@@ -715,11 +715,7 @@ function spip_php_session_start() {
**/
function is_php_session_started() {
if (php_sapi_name() !== 'cli') {
if (PHP_VERSION_ID >= 50400) {
return session_status() === PHP_SESSION_ACTIVE ? true : false;
} else {
return session_id() === '' ? false : true;
}
return session_status() === PHP_SESSION_ACTIVE ? true : false;
}
return false;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter