Skip to content

Commit

Permalink
Anpassung zur Überprüfung mbstring Extension
Browse files Browse the repository at this point in the history
Anpassung zur Überprüfung mbstring Extension
  • Loading branch information
christian1180 committed Nov 27, 2024
1 parent 29c0292 commit 94b6807
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@
$str = file_get_contents('config/categories.json');

// Prüfe UTF-8
if (!mb_check_encoding($str, 'UTF-8'))
{
echo "Datei 'config/categories.json' entspricht nicht dem UTF-8 Format. Bitte als UTF-8 speichern.";
exit();
}
if (extension_loaded("mbstring")) {
if (!mb_check_encoding($str, 'UTF-8'))
{
echo "Datei 'config/categories.json' entspricht nicht dem UTF-8 Format. Bitte als UTF-8 speichern.";
exit();
}
}

$json = json_decode($str, true);
$menu = $json['categories'];
Expand Down Expand Up @@ -125,11 +127,13 @@
$str = file_get_contents('config/custom.json');

// Prüfe UTF-8
if (!mb_check_encoding($str, 'UTF-8'))
{
echo "Datei 'config/custom.json' entspricht nicht dem UTF-8 Format. Bitte als UTF-8 speichern.";
exit();
}
if (extension_loaded("mbstring")) {
if (!mb_check_encoding($str, 'UTF-8'))
{
echo "Datei 'config/config/custom.json' entspricht nicht dem UTF-8 Format. Bitte als UTF-8 speichern.";
exit();
}
}


$json = json_decode($str, true);
Expand Down

0 comments on commit 94b6807

Please sign in to comment.