Permalink
Browse files

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
  • Loading branch information...
cash committed Dec 29, 2010
1 parent 96c27d9 commit ce7eb8ee45b4222e9ea5e63ed6941f19239b969d
Showing with 6 additions and 1 deletion.
  1. +6 −1 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) {

0 comments on commit ce7eb8e

Please sign in to comment.