Php renomme spontanémement les variable POST qui ont un '.'

Modification de variable pour que ca n'impacte pas le fonctionnement.
This commit is contained in:
Alan Garcia 2014-01-09 09:51:57 +00:00
parent 79023396cf
commit c4bae3f8ef
1 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,7 @@ function variable_init_maybe() {
*/
function variable_get($name, $default = null, $createit_comment = null) {
global $conf;
$name=str_replace('.', '_', $name); // Php can't handle POST var with a '.'
variable_init_maybe();
@ -112,6 +113,8 @@ function variable_set($name, $value, $comment=null) {
global $conf, $db, $err;
$err->log('variable', 'variable_set', '+'.serialize($value).'+'.$comment.'+');
$name=str_replace('.', '_', $name); // Php can't handle POST var with a '.'
$conf[$name] = $value;
if (is_object($value) || is_array($value)) {
$value = serialize($value);
@ -137,6 +140,7 @@ function variable_set($name, $value, $comment=null) {
*/
function variable_del($name) {
global $conf, $db;
$name=str_replace('.', '_', $name); // Php can't handle POST var with a '.'
$db->query("DELETE FROM `variable` WHERE name = '".$name."'");