Ejemplo n.º 1
0
 protected static function _get_format_data($data_type, $key, $type)
 {
     if ($type == HttpIO::PARAM_TYPE_OLDDATA) {
         # 如果是要拿原始拷贝,则加后缀
         $data_type .= '_OLD';
     }
     $data = HttpIO::_key_string(HttpIO::${$data_type}, $key);
     if (null === $data) {
         return null;
     }
     if (!$type) {
         # 未安全过滤的数据
         $data = HttpIO::sanitize_decode($data);
     } elseif ($type == HttpIO::PARAM_TYPE_URL) {
         # URL 格式数据
         $data = HttpIO::sanitize_decode($data);
         $data = str_replace(array('<', '>', '\'', "\"", '\''), array('%3C', '%3E', '%27', '%22', '%5C'), $data);
     }
     return $data;
 }