1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
<?php
/* * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) * Copyright (C) 2002-2005 The Nucleus Group * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * (see nucleus/documentation/index.html#license for more info) */ /** * @license http://nucleuscms.org/license.txt GNU General Public License * @copyright Copyright (C) 2002-2005 The Nucleus Group * @version $Id: vars4.1.0.php,v 1.10.2.1 2005/08/15 10:50:12 dekarma Exp $ */ function getVar($name) { return undoMagic($_GET[$name]); }
function postVar($name) { return undoMagic($_POST[$name]); }
function cookieVar($name) { return undoMagic($_COOKIE[$name]); }
function requestVar($name) { if(array_key_exists($name,$_REQUEST)) return undoMagic($_REQUEST[$name]); elseif( array_key_exists($name,$_GET)) return undoMagic($_GET[$name]); elseif( array_key_exists($name,$_POST)) return undoMagic($_POST[$name]); else return; }
function serverVar($name) { return $_SERVER[$name]; }
// removes magic quotes if that option is enabled function undoMagic($data) { return get_magic_quotes_gpc() ? stripslashes_array($data) : $data; }
function stripslashes_array($data) { return is_array($data) ? array_map('stripslashes', $data) : stripslashes($data); }
// integer array from request function requestIntArray($name) { return $_REQUEST[$name]; }
// array from request. Be sure to call undoMagic on the strings inside function requestArray($name) { return $_REQUEST[$name]; }
// add all the variables from the request as hidden input field // @see globalfunctions.php#passVar function passRequestVars() { foreach ($_REQUEST as $key => $value) { if (($key == 'action') && ($value != requestVar('nextaction'))) $key = 'nextaction'; // a nextaction of 'showlogin' makes no sense if (($key == 'nextaction') && ($value == 'showlogin')) continue; if (($key != 'login') && ($key != 'password')) passVar($key, $value); } }
function postFileInfo($name) { return $_FILES[$name]; }
function setOldAction($value) { $_POST['oldaction'] = $value; }
?>
|