From e8cacdcfdd9e370ec99bc81364254f9113fd1b17 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Thu, 3 Nov 2011 17:02:45 +0100 Subject: [PATCH] (backport) Fix a situation where globally stored template variables do not get preference over local (old) ones docs/NEWS --- docs/NEWS | 5 ++++- include/admin/templates.inc.php | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/NEWS b/docs/NEWS index 0c7b90c7..d258a629 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -13,7 +13,10 @@ Version 1.6.1 () * Fixed unneccessary preg_match notices in the statistics backend -Version 1.6 (October 27th, 2011) + * Fixed a possible problem where template-specific variables would + note be cleared in favor of the new global ones. + +Version 1.6 (October 27th 2011) ------------------------------------------------------------------------ * Fix XSS issue in mediadatabase and karma diff --git a/include/admin/templates.inc.php b/include/admin/templates.inc.php index 1c70f383..e0e34183 100644 --- a/include/admin/templates.inc.php +++ b/include/admin/templates.inc.php @@ -28,6 +28,10 @@ class template_option { function set_config($item, $value) { global $serendipity; + serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options + WHERE okey = 't_" . serendipity_db_escape_string($serendipity['template']) . "' + AND name = '" . serendipity_db_escape_string($item) . "'"); + if ($this->config[$item]['scope'] == 'global') { serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options WHERE okey = 't_global'