From 6e47c0be5c3b59cedbda8da8d708e69534964de2 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 03 Nov 2008 02:44:33 -0500
Subject: [PATCH] Handle magic_quotes on runtime and remove them from the requirements list (#1485285)

---
 program/include/main.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/program/include/main.inc b/program/include/main.inc
index 8eb2c81..4ed25af 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -420,8 +420,11 @@
       $value = $_COOKIE[$fname];
     }
   
+  // strip single quotes if magic_quotes_sybase is enabled
+  if (ini_get('magic_quotes_sybase'))
+    $value = str_replace("''", "'", $value);
   // strip slashes if magic_quotes enabled
-  if ((bool)get_magic_quotes_gpc())
+  else if (get_magic_quotes_gpc() || get_magic_quotes_runtime())
     $value = stripslashes($value);
 
   // remove HTML tags if not allowed    

--
Gitblit v1.9.1