Skip to content

Commit

Permalink
fix #69 : htmlentities ne doit pas forcer le charset
Browse files Browse the repository at this point in the history
Le charset doit être définie en amont à utf-8, avec la possibilité de ne pas le redéfinir.
L'utilisateur est donc capable maintenant de changer son charset avant l'appel à secure puis de le rétablir après si besoin.
  • Loading branch information
bulton-fr committed Aug 5, 2016
1 parent f4c653b commit 5ece812
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/BFW_init.php
Expand Up @@ -18,6 +18,18 @@
$rootPath = substr(__DIR__, 0, strpos(__DIR__, $myVendorName));
}

//Issue #69 : Ce n'est pas à htmlentities de forcer le charset.
//Possibilité de demander à ne pas le redéfinir
if(!isset($notDefineDefaultCharset))
{
$notDefineDefaultCharset = false;
}

if($notDefineDefaultCharset === false)
{
ini_set('default_charset', 'UTF-8');
}

//Fichier de config
if(!isset($forceConfig) || (isset($forceConfig) && $forceConfig == false))
{
Expand Down
2 changes: 1 addition & 1 deletion src/fonctions/global.php
Expand Up @@ -69,7 +69,7 @@ function secure($string, $html = false, $null_cslashe = false)

if($html === false)
{
$string = htmlentities($string, $optHtmlentities, 'UTF-8');
$string = htmlentities($string, $optHtmlentities);
}

if(function_exists('DB_protect'))
Expand Down

0 comments on commit 5ece812

Please sign in to comment.