mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-14983 add magic quotes stripping option into data_submitted()
This commit is contained in:
parent
3b8a284cca
commit
00f87f9793
1 changed files with 8 additions and 3 deletions
|
@ -449,16 +449,21 @@ 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 {
|
||||
if ($slashes===false) {
|
||||
$post = stripslashes_recursive($_POST); // temporary hack before magic quotes removal
|
||||
return (object)$post;
|
||||
} else {
|
||||
return (object)$_POST;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue