2 /***************************************************************************
3 * Copyright (C) 2003-2007 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 b($key, $default = false
)
46 return (bool
)Env
::_get($key, $default);
49 public static function i($key, $default = 0)
51 $i = Env
::_get($key, $default);
52 return is_numeric($i) ?
intval($i) : $default;
58 public static function _get($key, $default)
60 return isset($_POST[$key]) ?
$_POST[$key] : $default;
63 public static function has($key)
65 return isset($_POST[$key]);
68 public static function kill($key)
73 public static function v($key, $default = null
)
75 return Post
::_get($key, $default);
78 public static function b($key, $default = false
)
80 return (bool
)Post
::_get($key, $default);
83 public static function i($key, $default = 0)
85 $i = Post
::_get($key, $default);
86 return is_numeric($i) ?
intval($i) : $default;
92 public static function _get($key, $default)
94 return isset($_GET[$key]) ?
$_GET[$key] : $default;
97 public static function has($key)
99 return isset($_GET[$key]);
102 public static function kill($key)
107 public static function v($key, $default = null
)
109 return Get
::_get($key, $default);
112 public static function b($key, $default = false
)
114 return (bool
)Get
::_get($key, $default);
117 public static function i($key, $default = 0)
119 $i = Get
::_get($key, $default);
120 return is_numeric($i) ?
intval($i) : $default;
126 public static function _get($key, $default)
128 return isset($_COOKIE[$key]) ?
$_COOKIE[$key] : $default;
131 public static function has($key)
133 return isset($_COOKIE[$key]);
136 public static function kill($key)
138 unset($_COOKIE[$key]);
141 public static function v($key, $default = null
)
143 return Cookie
::_get($key, $default);
146 public static function b($key, $default = false
)
148 return (bool
)Cookie
::_get($key, $default);
151 public static function i($key, $default = 0)
153 $i = Cookie
::_get($key, $default);
154 return is_numeric($i) ?
intval($i) : $default;
158 function fix_gpc_magic(&$item, $key) {
159 if (is_array($item)) {
160 array_walk($item, 'fix_gpc_magic');
162 $item = stripslashes($item);
166 if (ini_get('magic_quotes_gpc') && empty($DONT_FIX_GPC)) {
167 array_walk($_GET, 'fix_gpc_magic');
168 array_walk($_POST, 'fix_gpc_magic');
169 array_walk($_COOKIE, 'fix_gpc_magic');
170 array_walk($_REQUEST, 'fix_gpc_magic');
173 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: