diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-29 20:14:53 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-29 20:14:53 +0000 |
commit | ce7eb8ee45b4222e9ea5e63ed6941f19239b969d (patch) | |
tree | 884c85887b765776272012eda26f3bf1b7accf67 /engine | |
parent | 96c27d9cb32636d679694c13d328f7211ec56dfb (diff) | |
download | elgg-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')
-rw-r--r-- | engine/lib/configuration.php | 7 |
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) { |