aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-17 02:38:19 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-17 02:38:19 +0000
commitc428d54dcc5524c641a45aa66e6a06a1df60e931 (patch)
treea21465deafce7ff302c524811bbde33096e39d76 /engine
parentcb3dbb5c961010ca32067f76fe666fe3162f42ce (diff)
downloadelgg-c428d54dcc5524c641a45aa66e6a06a1df60e931.tar.gz
elgg-c428d54dcc5524c641a45aa66e6a06a1df60e931.tar.bz2
Fixes #3123. Datalists and config names can now be up to 255 chars long. Debug mode is disabled when caching views to avoid saving bad stuff.
git-svn-id: http://code.elgg.org/elgg/trunk@8746 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/cache.php5
-rw-r--r--engine/lib/configuration.php8
-rw-r--r--engine/lib/upgrades/2011031600-1.8_svn-datalist_grows_up-0b8aec5a55cc1e1c.php18
-rw-r--r--engine/schema/mysql.sql4
4 files changed, 29 insertions, 6 deletions
diff --git a/engine/lib/cache.php b/engine/lib/cache.php
index bc279e8ea..d4888f9d9 100644
--- a/engine/lib/cache.php
+++ b/engine/lib/cache.php
@@ -213,6 +213,10 @@ function elgg_regenerate_simplecache($viewtype = NULL) {
$original_viewtype = elgg_get_viewtype();
+ // disable error reporting so we don't cache problems
+ $old_debug = elgg_get_config('debug');
+ elgg_set_config('debug', null);
+
foreach ($viewtypes as $viewtype) {
elgg_set_viewtype($viewtype);
foreach ($CONFIG->views->simplecache as $view) {
@@ -228,6 +232,7 @@ function elgg_regenerate_simplecache($viewtype = NULL) {
datalist_set("simplecache_lastcached_$viewtype", $lastcached);
}
+ elgg_set_config('debug', $old_debug);
elgg_set_viewtype($original_viewtype);
// needs to be set for links in html head
diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php
index 7e660c34b..4679a70d8 100644
--- a/engine/lib/configuration.php
+++ b/engine/lib/configuration.php
@@ -143,8 +143,8 @@ 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");
+ if (strlen($name) > 255) {
+ elgg_log("The name length for configuration variables cannot be greater than 255", "ERROR");
return false;
}
@@ -277,8 +277,8 @@ function datalist_set($name, $value) {
global $CONFIG, $DATALIST_CACHE;
// 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");
+ if (elgg_strlen($name) > 255) {
+ elgg_log("The name length for configuration variables cannot be greater than 255", "ERROR");
return false;
}
diff --git a/engine/lib/upgrades/2011031600-1.8_svn-datalist_grows_up-0b8aec5a55cc1e1c.php b/engine/lib/upgrades/2011031600-1.8_svn-datalist_grows_up-0b8aec5a55cc1e1c.php
new file mode 100644
index 000000000..379244b36
--- /dev/null
+++ b/engine/lib/upgrades/2011031600-1.8_svn-datalist_grows_up-0b8aec5a55cc1e1c.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Elgg 1.8-svn upgrade 2011031600
+ * datalist_grows_up
+ *
+ * Ups the varchar to 256 for the datalist and config table.
+ *
+ * Keeping it as a varchar because of the trailing whitespace trimming it apparently does:
+ * http://dev.mysql.com/doc/refman/5.0/en/char.html
+ */
+
+$db_prefix = elgg_get_config('dbprefix');
+
+$q = "ALTER TABLE {$db_prefix}datalists CHANGE name name VARCHAR(255)";
+update_data($q);
+
+$q = "ALTER TABLE {$db_prefix}config CHANGE name name VARCHAR(255)";
+update_data($q);
diff --git a/engine/schema/mysql.sql b/engine/schema/mysql.sql
index 526cc8ce6..74cf2ce74 100644
--- a/engine/schema/mysql.sql
+++ b/engine/schema/mysql.sql
@@ -94,7 +94,7 @@ CREATE TABLE `prefix_api_users` (
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `prefix_config` (
- `name` varchar(32) NOT NULL,
+ `name` varchar(255) NOT NULL,
`value` text NOT NULL,
`site_guid` int(11) NOT NULL,
PRIMARY KEY (`name`,`site_guid`)
@@ -108,7 +108,7 @@ CREATE TABLE `prefix_config` (
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `prefix_datalists` (
- `name` varchar(32) NOT NULL,
+ `name` varchar(255) NOT NULL,
`value` text NOT NULL,
PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;