diff --git a/lib/base.php b/lib/base.php
index 96215410ad7b5f8615e513f3a9b13829463632d9..8647705de8ae0d14d77ac79456edaead33f7ac26 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -324,6 +324,11 @@ class OC{
 		date_default_timezone_set('UTC');
 		ini_set('arg_separator.output','&');
 
+                // try to switch magic quotes off.
+                if(function_exists('set_magic_quotes_runtime')) {
+                        @set_magic_quotes_runtime(false);
+                }
+
 		//try to configure php to enable big file uploads.
 		//this doesn´t work always depending on the webserver and php configuration.
 		//Let´s try to overwrite some defaults anyways