135,11 → 135,9 |
* Procédure vérifiant l'encodage des tableaux $_GET et $_POST et les transcodant dans l'encodage de l'application |
*/ |
protected function verifierEtReencoderTableauRequete() { |
if(Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
|
$_POST = $this->encoderTableau($_POST, Config::get('appli_encodage'),Config::get('sortie_encodage')); |
$_GET = $this->encoderTableau($_GET, Config::get('appli_encodage'),Config::get('sortie_encodage')); |
|
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$_POST = $this->encoderTableau($_POST, Config::get('appli_encodage'), Config::get('sortie_encodage')); |
$_GET = $this->encoderTableau($_GET, Config::get('appli_encodage'), Config::get('sortie_encodage')); |
} |
} |
|
151,18 → 149,14 |
* @return Array Le tableau encodé dans l'encodage de sortie |
* |
*/ |
final protected function encoderTableau($tableau,$encodage_sortie,$encodage_entree = null) { |
|
final protected function encoderTableau($tableau, $encodage_sortie, $encodage_entree = null) { |
if (is_array($tableau)) { |
|
foreach ($tableau as $cle => $valeur) { |
|
if (is_array($valeur)) { |
$tableau[$cle] = $this->encoderTableau($tableau[$cle]); |
} else { |
$tableau[$cle] = mb_convert_encoding($valeur, $encodage_sortie, $encodage_entree); |
} |
else { |
$tableau[$cle] = mb_convert_encoding($valeur,$encodage_sortie,$encodage_entree); |
} |
} |
} |
|