summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2002-12-26 12:16:09 (GMT)
committerDries Buytaert2002-12-26 12:16:09 (GMT)
commit26e0b9b75c2cbb796449ae8acc9c130c66d5e740 (patch)
treebcfaf9d0518a31d5db2bd85a110dc53c70041a97
parent728125035c65d5a40b162ca1d824adcb294afe74 (diff)
- Made Drupal report an error when magic_quotes are disabled.
-rw-r--r--includes/common.inc6
-rw-r--r--index.php2
2 files changed, 8 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index ea1139e..4812e3e 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -50,6 +50,12 @@ function throttle($type, $rate) {
}
}
+function check_php_setting($name, $value) {
+ if (ini_get($name) != $value) {
+ print "<p>Note tat the value of PHP's configuration option <code><b>$name</b></code> is incorrect. It should be set to '$value' for Drupal to work properly. Either configure your webserver to support <code>.htaccess</code> files so Drupal's <code>.htaccess</code> file can set it to the proper value, or edit your <code>php.ini</code> file directly. This message will automatically dissapear when the problem has been fixed.</p>";
+ }
+}
+
function array2object($node) {
if (is_array($node)) {
diff --git a/index.php b/index.php
index 0cd82eb..f92caa3 100644
--- a/index.php
+++ b/index.php
@@ -5,6 +5,8 @@ include_once "includes/common.inc";
page_header();
+check_php_setting("magic_quotes_gpc", 0);
+
if (module_hook(variable_get("site_frontpage", "node"), "page")) {
module_invoke(variable_get("site_frontpage", "node"), "page");
}