From 89177306a2278255d6a2203b5fff4a839183d3cd Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 24 Jun 2012 14:00:49 +0200 Subject: Introducing a $_REQUEST/POST/GET wrapper This new wrapper ensures types are correct and accessed parameters are actually set (with custom default fallbacks). The wrapper is available in the global $INPUT variable. It accesses $_REQUEST by default. If POST or GET is required, the post and get members can be used: $INPUT->int('foo',false); // access $_REQUEST['foo'], default false $INPUT->post->int('foo'); // access $_POST['foo'], default 0 $INPUT->get->int('foo'); // access $_GET['foo'], default 0 The codebase still needs to be updated to make use of this. --- inc/init.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index 403fbe4ab..1907aea09 100644 --- a/inc/init.php +++ b/inc/init.php @@ -197,6 +197,10 @@ if (empty($plugin_controller_class)) $plugin_controller_class = 'Doku_Plugin_Con // load libraries require_once(DOKU_INC.'inc/load.php'); +// input handle class +global $INPUT; +$INPUT = new Input(); + // initialize plugin controller $plugin_controller = new $plugin_controller_class(); -- cgit v1.2.3