Esempio n. 1
0
 /**
  * Applies any transformations (make sure magic quotes is off, nesting, and json decoding) to an array variables
  * @param array $vars
  * @param boolean $transform.  Defaults to true
  * @returns $vars;
  */
 public static function fixupRequestVariables($vars)
 {
     if (!is_array($vars)) {
         return array();
     }
     $vars = I2CE_Util::transformVariables($vars);
     if (!array_key_exists('i2ce_json', $vars)) {
         return $vars;
     }
     $json = $vars['i2ce_json'];
     unset($vars['i2ce_json']);
     if (is_string($json) && strlen($json) > 0) {
         $json = array($json);
     }
     if (is_array($json)) {
         foreach ($json as $v) {
             I2CE_Util::merge_recursive($vars, json_decode($v, true));
         }
     }
     return $vars;
 }