Skip to content

Commit

Permalink
Magic quotes may be ON so we need to stripslashes in that case.
Browse files Browse the repository at this point in the history
  • Loading branch information
franbenz committed Jun 2, 2014
1 parent 92cfb7d commit 5266292
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/restapi.php
Expand Up @@ -14,6 +14,23 @@ class restapi extends phplistPlugin {
function restapi() {
parent::phplistplugin();
$this->coderoot = dirname(__FILE__) . '/restapi/';
// Need to find a better time to strip slashes. This is already done for the web interface in storemessage.php
// recursively strip slashes from an array
function stripslashes_r($array) {
foreach ($array as $key => $value) {
$array[$key] = is_array($value) ?
stripslashes_r($value) :
stripslashes($value);
}
return $array;
}

if (get_magic_quotes_gpc()) {
$_GET = stripslashes_r($_GET);
$_POST = stripslashes_r($_POST);
$_COOKIE = stripslashes_r($_COOKIE);
$_REQUEST = stripslashes_r($_REQUEST);
}
}

function adminmenu() {
Expand Down

0 comments on commit 5266292

Please sign in to comment.