2 /***************************************************************************
3 * Copyright (C) 2003-2008 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
24 public static function _get($key, $default)
26 return isset($_REQUEST[$key]) ?
$_REQUEST[$key] : $default;
29 public static function has($key)
31 return isset($_REQUEST[$key]);
34 public static function kill($key)
36 unset($_REQUEST[$key]);
39 public static function v($key, $default = null
)
41 return Env
::_get($key, $default);
44 public static function s($key, $default = '')
46 return (string)Env
::_get($key, $default);
49 public static function b($key, $default = false
)
51 return (bool
)Env
::_get($key, $default);
54 public static function i($key, $default = 0)
56 $i = Env
::_get($key, $default);
57 return is_numeric($i) ?
intval($i) : $default;
60 public static function l(array $keys)
62 return array_map(array('Env', 'v'), $keys);
68 public static function _get($key, $default)
70 return isset($_POST[$key]) ?
$_POST[$key] : $default;
73 public static function has($key)
75 return isset($_POST[$key]);
78 public static function kill($key)
83 public static function v($key, $default = null
)
85 return Post
::_get($key, $default);
88 public static function b($key, $default = false
)
90 return (bool
)Post
::_get($key, $default);
93 public static function s($key, $default = '')
95 return (string)Post
::_get($key, $default);
98 public static function i($key, $default = 0)
100 $i = Post
::_get($key, $default);
101 return is_numeric($i) ?
intval($i) : $default;
104 public static function l(array $keys)
106 return array_map(array('Post', 'v'), $keys);
112 public static function _get($key, $default)
114 return isset($_GET[$key]) ?
$_GET[$key] : $default;
117 public static function has($key)
119 return isset($_GET[$key]);
122 public static function kill($key)
127 public static function v($key, $default = null
)
129 return Get
::_get($key, $default);
132 public static function b($key, $default = false
)
134 return (bool
)Get
::_get($key, $default);
137 public static function s($key, $default = '')
139 return (string)Get
::_get($key, $default);
142 public static function i($key, $default = 0)
144 $i = Get
::_get($key, $default);
145 return is_numeric($i) ?
intval($i) : $default;
148 public static function l(array $keys)
150 return array_map(array('Get', 'v'), $keys);
156 public static function _get($key, $default)
158 return isset($_COOKIE[$key]) ?
$_COOKIE[$key] : $default;
161 public static function has($key)
163 return isset($_COOKIE[$key]);
166 public static function kill($key)
168 unset($_COOKIE[$key]);
171 public static function v($key, $default = null
)
173 return Cookie
::_get($key, $default);
176 public static function s($key, $default = '')
178 return (string)Cookie
::_get($key, $default);
181 public static function b($key, $default = false
)
183 return (bool
)Cookie
::_get($key, $default);
186 public static function i($key, $default = 0)
188 $i = Cookie
::_get($key, $default);
189 return is_numeric($i) ?
intval($i) : $default;
192 public static function l(array $keys)
194 return array_map(array('Cookie', 'v'), $keys);
198 function fix_gpc_magic(&$item, $key) {
199 if (is_array($item)) {
200 array_walk($item, 'fix_gpc_magic');
202 $item = stripslashes($item);
206 if (ini_get('magic_quotes_gpc') && empty($DONT_FIX_GPC)) {
207 array_walk($_GET, 'fix_gpc_magic');
208 array_walk($_POST, 'fix_gpc_magic');
209 array_walk($_COOKIE, 'fix_gpc_magic');
210 array_walk($_REQUEST, 'fix_gpc_magic');
213 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: