From: skodak Date: Sun, 25 May 2008 15:34:19 +0000 (+0000) Subject: MDL-14983 add magic quotes stripping option into data_submitted() X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=00f87f9793c26983cb7ed37b2c0b9f2ceae79666;p=moodle.git MDL-14983 add magic quotes stripping option into data_submitted() --- diff --git a/lib/weblib.php b/lib/weblib.php index f88e0341c2..621f40ace3 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -449,15 +449,20 @@ class moodle_url { * * Checks that submitted POST data exists and returns it as object. * - * @param string $url not used anymore + * @param bool slashes TEMPORARY - false if strip magic quotes * @return mixed false or object */ -function data_submitted($url='') { +function data_submitted($slashes=true) { if (empty($_POST)) { return false; } else { - return (object)$_POST; + if ($slashes===false) { + $post = stripslashes_recursive($_POST); // temporary hack before magic quotes removal + return (object)$post; + } else { + return (object)$_POST; + } } }