diff options
| author | Graham Eames <grahamje@users.sourceforge.net> | 2006-10-01 11:10:15 +0000 |
|---|---|---|
| committer | Graham Eames <grahamje@users.sourceforge.net> | 2006-10-01 11:10:15 +0000 |
| commit | c42b75d1bc1154c849b5f55becfc42452242c86d (patch) | |
| tree | 014b2f9512c25e1b2ee0aa1d8c80bf8d39e15244 /phpBB/includes/functions.php | |
| parent | bc15445b58403c92ebca9e23ef3d9a59fbdccc92 (diff) | |
| download | forums-c42b75d1bc1154c849b5f55becfc42452242c86d.tar forums-c42b75d1bc1154c849b5f55becfc42452242c86d.tar.gz forums-c42b75d1bc1154c849b5f55becfc42452242c86d.tar.bz2 forums-c42b75d1bc1154c849b5f55becfc42452242c86d.tar.xz forums-c42b75d1bc1154c849b5f55becfc42452242c86d.zip | |
Prevent cookies from other applications interfering with our forms
git-svn-id: file:///svn/phpbb/trunk@6423 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
| -rw-r--r-- | phpBB/includes/functions.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index fb0258996c..6093976084 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -52,8 +52,17 @@ function set_var(&$result, $var, $type, $multibyte = false) * * Used to get passed variable */ -function request_var($var_name, $default, $multibyte = false) +function request_var($var_name, $default, $multibyte = false, $cookie = false) { + if (!$cookie && isset($_COOKIE[$var_name])) + { + if (!isset($_GET[$var_name]) && !isset($_POST[$var_name])) + { + return (is_array($default)) ? array() : $default; + } + $_REQUEST[$var_name] = isset($_POST[$var_name]) ? $_POST[$var_name] : $_GET[$var_name]; + } + if (!isset($_REQUEST[$var_name]) || (is_array($_REQUEST[$var_name]) && !is_array($default)) || (is_array($default) && !is_array($_REQUEST[$var_name]))) { return (is_array($default)) ? array() : $default; |
