MDL-14983 add magic quotes stripping option into data_submitted()

This commit is contained in:
skodak 2008-05-25 15:34:19 +00:00
parent 3b8a284cca
commit 00f87f9793

View file

@ -449,15 +449,20 @@ class moodle_url {
* *
* Checks that submitted POST data exists and returns it as object. * 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 * @return mixed false or object
*/ */
function data_submitted($url='') { function data_submitted($slashes=true) {
if (empty($_POST)) { if (empty($_POST)) {
return false; return false;
} else { } else {
return (object)$_POST; if ($slashes===false) {
$post = stripslashes_recursive($_POST); // temporary hack before magic quotes removal
return (object)$post;
} else {
return (object)$_POST;
}
} }
} }