aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-23 23:42:45 -0800
committerFriendika <info@friendika.com>2010-11-23 23:42:45 -0800
commit81636f6f5f1a8e6d3f9758ee68bebf6cb9a5d99f (patch)
treef0750dc6a1fa1c628d85ef8b5fdbcd97cc06fce1
parentdd52aec243cd16f7ff05026b91f984788cafad56 (diff)
downloadvolse-hubzilla-81636f6f5f1a8e6d3f9758ee68bebf6cb9a5d99f.tar.gz
volse-hubzilla-81636f6f5f1a8e6d3f9758ee68bebf6cb9a5d99f.tar.bz2
volse-hubzilla-81636f6f5f1a8e6d3f9758ee68bebf6cb9a5d99f.zip
undo magic quotes setting if present
-rw-r--r--boot.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index b55c3198b..a31d0f4aa 100644
--- a/boot.php
+++ b/boot.php
@@ -94,6 +94,25 @@ define ( 'GRAVITY_PARENT', 0);
define ( 'GRAVITY_LIKE', 3);
define ( 'GRAVITY_COMMENT', 6);
+// Please disable magic_quotes_gpc so we don't have to do this.
+// See http://php.net/manual/en/security.magicquotes.disabling.php
+
+if (get_magic_quotes_gpc()) {
+ $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
+ while (list($key, $val) = each($process)) {
+ foreach ($val as $k => $v) {
+ unset($process[$key][$k]);
+ if (is_array($v)) {
+ $process[$key][stripslashes($k)] = $v;
+ $process[] = &$process[$key][stripslashes($k)];
+ } else {
+ $process[$key][stripslashes($k)] = stripslashes($v);
+ }
+ }
+ }
+ unset($process);
+}
+
// Our main application structure for the life of this page
// Primarily deals with the URL that got us here