Fix UTF-8 minification
This commit is contained in:
parent
690b862cce
commit
bb28ded0e7
@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
class core extends common
|
class core extends common
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -892,15 +892,23 @@ class core extends common
|
|||||||
case self::DISPLAY_LAYOUT_LIGHT:
|
case self::DISPLAY_LAYOUT_LIGHT:
|
||||||
ob_start();
|
ob_start();
|
||||||
require 'core/layout/light.php';
|
require 'core/layout/light.php';
|
||||||
$content = preg_replace('/\s+/', ' ', ob_get_clean());
|
|
||||||
|
// Supprime les espaces, les sauts de ligne, les tabulations et autres caractères inutiles
|
||||||
|
$content = preg_replace('/\s+/u', ' ', ob_get_clean());
|
||||||
|
|
||||||
|
// Convertit la chaîne en UTF-8 pour conserver les caractères accentués
|
||||||
|
$content = mb_convert_encoding($content, 'UTF-8', 'UTF-8');
|
||||||
echo $content;
|
echo $content;
|
||||||
break;
|
break;
|
||||||
// Layout principal
|
// Layout principal
|
||||||
case self::DISPLAY_LAYOUT_MAIN:
|
case self::DISPLAY_LAYOUT_MAIN:
|
||||||
ob_start();
|
ob_start();
|
||||||
require 'core/layout/main.php';
|
require 'core/layout/main.php';
|
||||||
// Supprime les espaces et les sauts de ligne inutiles
|
// Supprime les espaces, les sauts de ligne, les tabulations et autres caractères inutiles
|
||||||
$content = preg_replace('/\s+/', ' ', ob_get_clean());
|
$content = preg_replace('/\s+/u', ' ', ob_get_clean());
|
||||||
|
|
||||||
|
// Convertit la chaîne en UTF-8 pour conserver les caractères accentués
|
||||||
|
$content = mb_convert_encoding($content, 'UTF-8', 'UTF-8');
|
||||||
echo $content;
|
echo $content;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user