forked from ZwiiCMS-Team/ZwiiCMS
Merge commit 'f18d4eee1d1cd9500a30d47d05bea1f773d787af' into HEAD
This commit is contained in:
commit
9052247e53
@ -35,7 +35,7 @@ class helper
|
|||||||
file_put_contents ('core/module/install/ressource/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents ('core/module/install/ressource/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return (array_key_exists($text, core::$dialog) && !empty(core::$dialog[$text]) ? core::$dialog[$text] : $text);
|
return (array_key_exists($text, core::$dialog) && !empty (core::$dialog[$text]) ? core::$dialog[$text] : $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,7 +57,7 @@ class helper
|
|||||||
if (!file_exists('site/i18n/' . $to . '.json')) {
|
if (!file_exists('site/i18n/' . $to . '.json')) {
|
||||||
file_put_contents('site/i18n/' . $to . '.json', json_encode([]));
|
file_put_contents('site/i18n/' . $to . '.json', json_encode([]));
|
||||||
}
|
}
|
||||||
if (!empty($text)) {
|
if (!empty ($text)) {
|
||||||
//Lecture des données en ligne
|
//Lecture des données en ligne
|
||||||
$data = json_decode(file_get_contents('site/i18n/' . $to . '.json'), true);
|
$data = json_decode(file_get_contents('site/i18n/' . $to . '.json'), true);
|
||||||
// Mode traduction
|
// Mode traduction
|
||||||
@ -92,9 +92,9 @@ class helper
|
|||||||
|
|
||||||
public static function getIp($anon = 4)
|
public static function getIp($anon = 4)
|
||||||
{
|
{
|
||||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
if (!empty ($_SERVER['HTTP_CLIENT_IP'])) {
|
||||||
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
||||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
} elseif (!empty ($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||||
} else {
|
} else {
|
||||||
$ip = $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||||||
@ -156,7 +156,7 @@ class helper
|
|||||||
public static function arraycolumn($array, $column, $sort = null)
|
public static function arraycolumn($array, $column, $sort = null)
|
||||||
{
|
{
|
||||||
$newArray = [];
|
$newArray = [];
|
||||||
if (empty($array) === false) {
|
if (empty ($array) === false) {
|
||||||
$newArray = array_map(function ($element) use ($column) {
|
$newArray = array_map(function ($element) use ($column) {
|
||||||
return $element[$column];
|
return $element[$column];
|
||||||
}, $array);
|
}, $array);
|
||||||
@ -193,7 +193,7 @@ class helper
|
|||||||
{
|
{
|
||||||
// Creation du ZIP
|
// Creation du ZIP
|
||||||
$baseName = str_replace('/', '', helper::baseUrl(false, false));
|
$baseName = str_replace('/', '', helper::baseUrl(false, false));
|
||||||
$baseName = empty($baseName) ? 'ZwiiCMS' : $baseName;
|
$baseName = empty ($baseName) ? 'ZwiiCMS' : $baseName;
|
||||||
$fileName = $baseName . '-backup-' . date('Y-m-d-H-i-s', time()) . '.zip';
|
$fileName = $baseName . '-backup-' . date('Y-m-d-H-i-s', time()) . '.zip';
|
||||||
$zip = new ZipArchive();
|
$zip = new ZipArchive();
|
||||||
$zip->open($folder . $fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
$zip->open($folder . $fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||||
@ -295,7 +295,7 @@ class helper
|
|||||||
public static function isHttps()
|
public static function isHttps()
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
(empty($_SERVER['HTTPS']) === false and $_SERVER['HTTPS'] !== 'off')
|
(empty ($_SERVER['HTTPS']) === false and $_SERVER['HTTPS'] !== 'off')
|
||||||
or $_SERVER['SERVER_PORT'] === 443
|
or $_SERVER['SERVER_PORT'] === 443
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
@ -367,7 +367,7 @@ class helper
|
|||||||
{
|
{
|
||||||
$version = helper::getOnlineVersion($channel);
|
$version = helper::getOnlineVersion($channel);
|
||||||
$update = false;
|
$update = false;
|
||||||
if (!empty($version)) {
|
if (!empty ($version)) {
|
||||||
$update = version_compare(common::ZWII_VERSION, $version) == -1;
|
$update = version_compare(common::ZWII_VERSION, $version) == -1;
|
||||||
}
|
}
|
||||||
return $update;
|
return $update;
|
||||||
@ -434,8 +434,8 @@ class helper
|
|||||||
$text = mb_strtolower($text, 'UTF-8');
|
$text = mb_strtolower($text, 'UTF-8');
|
||||||
$text = strip_tags(
|
$text = strip_tags(
|
||||||
str_replace(
|
str_replace(
|
||||||
explode(',', 'á,à,â,ä,ã,å,ç,é,è,ê,ë,í,ì,î,ï,ñ,ó,ò,ô,ö,õ,ú,ù,û,ü,ý,ÿ,\',", '),
|
explode(',', 'á,à,â,ä,ã,å,ç,é,è,ê,ë,í,ì,î,ï,ñ,ó,ò,ô,ö,õ,ú,ù,û,ü,ý,ÿ,\',", ,//'),
|
||||||
explode(',', 'a,a,a,a,a,a,c,e,e,e,e,i,i,i,i,n,o,o,o,o,o,u,u,u,u,y,y,-,-,-'),
|
explode(',', 'a,a,a,a,a,a,c,e,e,e,e,i,i,i,i,n,o,o,o,o,o,u,u,u,u,y,y,-,-,-,-'),
|
||||||
$text
|
$text
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -445,7 +445,7 @@ class helper
|
|||||||
// Supprime les tirets en fin de chaine (emoji en fin de nom)
|
// Supprime les tirets en fin de chaine (emoji en fin de nom)
|
||||||
$text = rtrim($text, '-');
|
$text = rtrim($text, '-');
|
||||||
// Cas où un identifiant est vide
|
// Cas où un identifiant est vide
|
||||||
if (empty($text)) {
|
if (empty ($text)) {
|
||||||
$text = uniqid('');
|
$text = uniqid('');
|
||||||
}
|
}
|
||||||
// Un ID ne peut pas être un entier, pour éviter les conflits avec le système de pagination
|
// Un ID ne peut pas être un entier, pour éviter les conflits avec le système de pagination
|
||||||
|
Loading…
Reference in New Issue
Block a user