7e5212aa7213f65ed0f97ac585f2ed6ba7fec05b
2 /***************************************************************************
3 * Copyright (C) 2003-2006 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
26 public static function _get($key, $default)
28 return isset($_REQUEST[$key]) ?
$_REQUEST[$key] : $default;
32 // {{{ public static function has
34 public static function has($key)
36 return isset($_REQUEST[$key]);
40 // {{{ public static function kill
42 public static function kill($key)
44 unset($_REQUEST[$key]);
48 // {{{ public static function v
50 public static function v($key, $default = null
)
52 return Env
::_get($key, $default);
56 // {{{ public static function b
58 public static function b($key, $default = false
)
60 return (bool
)Env
::_get($key, $default);
64 // {{{ public static function i
66 public static function i($key, $default = 0)
68 $i = Env
::_get($key, $default);
69 return is_numeric($i) ?
intval($i) : $default;
78 // {{{ public static function _get
80 public static function _get($key, $default)
82 return isset($_POST[$key]) ?
$_POST[$key] : $default;
86 // {{{ public static function has
88 public static function has($key)
90 return isset($_POST[$key]);
94 // {{{ public static function kill
96 public static function kill($key)
102 // {{{ public static function v
104 public static function v($key, $default = null
)
106 return Post
::_get($key, $default);
110 // {{{ public static function b
112 public static function b($key, $default = false
)
114 return (bool
)Post
::_get($key, $default);
118 // {{{ public static function i
120 public static function i($key, $default = 0)
122 $i = Post
::_get($key, $default);
123 return is_numeric($i) ?
intval($i) : $default;
131 // {{{ public static function _get
133 public static function _get($key, $default)
135 return isset($_GET[$key]) ?
$_GET[$key] : $default;
139 // {{{ public static function has
141 public static function has($key)
143 return isset($_GET[$key]);
147 // {{{ public static function kill
149 public static function kill($key)
155 // {{{ public static function v
157 public static function v($key, $default = null
)
159 return Get
::_get($key, $default);
163 // {{{ public static function b
165 public static function b($key, $default = false
)
167 return (bool
)Get
::_get($key, $default);
171 // {{{ public static function i
173 public static function i($key, $default = 0)
175 $i = Get
::_get($key, $default);
176 return is_numeric($i) ?
intval($i) : $default;
184 // {{{ public static function _get
186 public static function _get($key, $default)
188 return isset($_COOKIE[$key]) ?
$_COOKIE[$key] : $default;
192 // {{{ public static function has
194 public static function has($key)
196 return isset($_COOKIE[$key]);
200 // {{{ public static function kill
202 public static function kill($key)
204 unset($_COOKIE[$key]);
208 // {{{ public static function v
210 public static function v($key, $default = null
)
212 return Cookie
::_get($key, $default);
216 // {{{ public static function b
218 public static function b($key, $default = false
)
220 return (bool
)Cookie
::_get($key, $default);
224 // {{{ public static function i
226 public static function i($key, $default = 0)
228 $i = Cookie
::_get($key, $default);
229 return is_numeric($i) ?
intval($i) : $default;
235 function fix_gpc_magic(&$item, $key) {
236 if (is_array($item)) {
237 array_walk($item, 'fix_gpc_magic');
239 $item = stripslashes($item);
243 if (ini_get('magic_quotes_gpc') && empty($DONT_FIX_GPC)) {
244 array_walk($_GET, 'fix_gpc_magic');
245 array_walk($_POST, 'fix_gpc_magic');
246 array_walk($_COOKIE, 'fix_gpc_magic');
247 array_walk($_REQUEST, 'fix_gpc_magic');
250 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: