From 5da364f8f93478036c915eee1d28a686ea69daaa Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 29 Apr 2011 20:10:00 -0700 Subject: [PATCH] Detect and fatal on magic_quotes_gpc Summary: This is evil, don't run with it enabled. Somehow got enabled on my laptop? Test Plan: Loaded phabricator with magic_quotes_gpc enabled, was rebuffed. Reviewed By: aran Reviewers: jungejason, tuomaspelkonen, aran CC: aran Differential Revision: 184 --- webroot/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webroot/index.php b/webroot/index.php index 48c03b3917..7f22c42f2e 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -16,6 +16,7 @@ * limitations under the License. */ + error_reporting(E_ALL | E_STRICT); ini_set('memory_limit', -1); @@ -43,6 +44,13 @@ if (!isset($_REQUEST['__path__'])) { "__path__ is not set. Your rewrite rules are not configured correctly."); } +if (get_magic_quotes_gpc()) { + phabricator_fatal_config_error( + "Your server is configured with PHP 'magic_quotes_gpc' enabled. This ". + "feature is 'highly discouraged' by PHP's developers and you must ". + "disable it to run Phabricator. Consult the PHP manual for instructions."); +} + require_once dirname(dirname(__FILE__)).'/conf/__init_conf__.php'; try {