aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/configuration.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 20:14:53 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 20:14:53 +0000
commitce7eb8ee45b4222e9ea5e63ed6941f19239b969d (patch)
tree884c85887b765776272012eda26f3bf1b7accf67 /engine/lib/configuration.php
parent96c27d9cb32636d679694c13d328f7211ec56dfb (diff)
downloadelgg-ce7eb8ee45b4222e9ea5e63ed6941f19239b969d.tar.gz
elgg-ce7eb8ee45b4222e9ea5e63ed6941f19239b969d.tar.bz2
added a catch for configuration names longer than 32 characters
git-svn-id: http://code.elgg.org/elgg/trunk@7753 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/configuration.php')
-rw-r--r--engine/lib/configuration.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php
index c79aff2d6..4bbed775c 100644
--- a/engine/lib/configuration.php
+++ b/engine/lib/configuration.php
@@ -120,7 +120,7 @@ function elgg_set_config($name, $value) {
/**
* Save a configuration setting
*
- * @param string $name Configuration name
+ * @param string $name Configuration name (cannot be greater than 32 characters)
* @param mixed $value Configuration value. Should be string for installation setting
* @param int $site_guid NULL for installation setting, 0 for default site
*
@@ -132,6 +132,11 @@ function elgg_save_config($name, $value, $site_guid = 0) {
$name = trim($name);
+ if (strlen($name) > 32) {
+ elgg_log("The name length for configuration variables cannot be greater than 32", "ERROR");
+ return false;
+ }
+
elgg_set_config($name, $value);
if ($site_guid === NULL) {