Esempio n. 1
0
 public static function getInput($dat, $key, $type, $default = false)
 {
     global ${$dat};
     $dat = ${$dat};
     if (!isset($dat[$key])) {
         return $default;
     } else {
         $value = $dat[$key];
         // Check for some small "input filtering"
         switch ($type) {
             case 'float':
                 $value = str_replace(',', '.', $value);
         }
         // Check if the value has the right type
         if (Core_Tools::checkInput($value, $type)) {
             return $value;
         } else {
             return $default;
         }
     }
 }