This commit is contained in:
xdrm-brackets 2017-12-11 18:03:51 +01:00
parent c2f1c9e627
commit e39c9cebe6
1 changed files with 3 additions and 3 deletions

View File

@ -320,14 +320,14 @@
if( isset($config['rename']) && is_string($config['rename']) && preg_match('@^\w+$@', $config['rename']) ) if( isset($config['rename']) && is_string($config['rename']) && preg_match('@^\w+$@', $config['rename']) )
$rename = $config['rename']; $rename = $config['rename'];
/* (1) On récupère si le paramètre est optionnel ou pas */ /* (2) On récupère si le paramètre est optionnel ou pas */
$optional = isset($config['optional']) && $config['optional'] === true; $optional = isset($config['optional']) && $config['optional'] === true;
/* (2) Si de type 'FILE' + fichier existe => on enregistre la ref. */ /* (3) Si de type 'FILE' + fichier existe => on enregistre la ref. */
if( $config['type'] == 'FILE' && isset($_FILES[$name]) ) if( $config['type'] == 'FILE' && isset($_FILES[$name]) )
$this->params[$rename] = &$_FILES[$name]; $this->params[$rename] = &$_FILES[$name];
/* (3) Si param obligatoire et manquant -> erreur */ /* (4) Si param obligatoire et manquant -> erreur */
if( !isset($this->raw_params[$name]) && !$optional ) if( !isset($this->raw_params[$name]) && !$optional )
return $this->error->set(Err::MissingParam, $name); return $this->error->set(Err::MissingParam, $name);