From ce7eb8ee45b4222e9ea5e63ed6941f19239b969d Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 29 Dec 2010 20:14:53 +0000 Subject: 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 --- engine/lib/configuration.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engine/lib') 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) { -- cgit v1.2.3