From 3c243370e251e9b48d12e4d129834305e1acffdc Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 16 Apr 2008 08:48:52 +0000 Subject: Added better GET query variable handling into the page handler mix git-svn-id: https://code.elgg.org/elgg/trunk@471 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/input.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'engine/lib/input.php') diff --git a/engine/lib/input.php b/engine/lib/input.php index c1b575e64..8cbea6986 100644 --- a/engine/lib/input.php +++ b/engine/lib/input.php @@ -23,9 +23,31 @@ if (isset($_REQUEST[$variable])) { $value = $_REQUEST[$variable]; return trim($_REQUEST[$variable]); - } + } + + global $CONFIG; + + if (isset($CONFIG->input[$variable])) + return $CONFIG->input[$variable]; return $default; - } + } + + /** + * Sets an input value that may later be retrieved by get_input + * + * @param string $variable The name of the variable + * @param string $value The value of the variable + */ + function set_input($variable, $value) { + + global $CONFIG; + if (!isset($CONFIG->input)) + $CONFIG->input = array(); + $CONFIG->input[trim($variable)] = trim($value); + + } + + ?> \ No newline at end of file -- cgit v1.2.3