]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3123 - Correct name length control in datalist_get and set_config
authorPaweł Sroka <srokap@gmail.com>
Thu, 17 Jan 2013 21:07:06 +0000 (22:07 +0100)
committerPaweł Sroka <srokap@gmail.com>
Thu, 17 Jan 2013 21:11:24 +0000 (22:11 +0100)
engine/lib/configuration.php

index b10e5113013bbea880e9a5a40b7cc58d0d0b44e4..3850215814d094ea98f36d4dd5bc57988273e05c 100644 (file)
@@ -138,7 +138,7 @@ function elgg_set_config($name, $value) {
 /**
  * Save a configuration setting
  *
- * @param string $name      Configuration name (cannot be greater than 32 characters)
+ * @param string $name      Configuration name (cannot be greater than 255 characters)
  * @param mixed  $value     Configuration value. Should be string for installation setting
  * @param int    $site_guid NULL for installation setting, 0 for default site
  *
@@ -227,9 +227,9 @@ function datalist_get($name) {
 
        $name = trim($name);
 
-       // cannot store anything longer than 32 characters in db, so catch here
-       if (elgg_strlen($name) > 32) {
-               elgg_log("The name length for configuration variables cannot be greater than 32", "ERROR");
+       // cannot store anything longer than 255 characters in db, so catch here
+       if (elgg_strlen($name) > 255) {
+               elgg_log("The name length for configuration variables cannot be greater than 255", "ERROR");
                return false;
        }
 
@@ -286,7 +286,7 @@ function datalist_get($name) {
 function datalist_set($name, $value) {
        global $CONFIG, $DATALIST_CACHE;
 
-       // cannot store anything longer than 32 characters in db, so catch before we set
+       // cannot store anything longer than 255 characters in db, so catch before we set
        if (elgg_strlen($name) > 255) {
                elgg_log("The name length for configuration variables cannot be greater than 255", "ERROR");
                return false;
@@ -332,7 +332,7 @@ function datalist_set($name, $value) {
  * This will cause the run once function to be run on all installations.  To perform
  * additional upgrades, create new functions for each release.
  *
- * @warning The function name cannot be longer than 32 characters long due to
+ * @warning The function name cannot be longer than 255 characters long due to
  * the current schema for the datalist table.
  *
  * @internal A datalist entry $functioname is created with the value of time().
@@ -419,9 +419,9 @@ function set_config($name, $value, $site_guid = 0) {
 
        $name = trim($name);
 
-       // cannot store anything longer than 32 characters in db, so catch before we set
-       if (elgg_strlen($name) > 32) {
-               elgg_log("The name length for configuration variables cannot be greater than 32", "ERROR");
+       // cannot store anything longer than 255 characters in db, so catch before we set
+       if (elgg_strlen($name) > 255) {
+               elgg_log("The name length for configuration variables cannot be greater than 255", "ERROR");
                return false;
        }