[geeklog-hg] geeklog: Code cleanup and changed the names of a few of the sani...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Oct 3 13:17:08 EDT 2015
changeset 9630:fcdb6fe3b76e
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/fcdb6fe3b76e
user: Tom
date: Sat Oct 03 13:16:29 2015 -0400
description:
Code cleanup and changed the names of a few of the sanitize rules for the Configuration to better reflect what they do
diffstat:
public_html/admin/configuration_validation.php | 25 +++++++++-----
system/classes/config.class.php | 45 ++-----------------------
2 files changed, 21 insertions(+), 49 deletions(-)
diffs (120 lines):
diff -r 18405a43253d -r fcdb6fe3b76e public_html/admin/configuration_validation.php
--- a/public_html/admin/configuration_validation.php Fri Oct 02 13:51:20 2015 -0400
+++ b/public_html/admin/configuration_validation.php Sat Oct 03 13:16:29 2015 -0400
@@ -41,7 +41,10 @@
$_CONF_VALIDATE['Core']['site_slogan'] = array('rule' => 'stringOrEmpty');
$_CONF_VALIDATE['Core']['owner_name'] = array('rule' => 'stringOrEmpty');
$_CONF_VALIDATE['Core']['microsummary_short'] = array('rule' => 'stringOrEmpty');
-$_CONF_VALIDATE['Core']['site_disabled_msg'] = array('rule' => 'stringOrEmpty', 'sanitize' => 'approveHTML');
+$_CONF_VALIDATE['Core']['site_disabled_msg'] = array(
+ 'sanitize' => 'approvedTags',
+ 'rule' => 'stringOrEmpty'
+);
$_CONF_VALIDATE['Core']['copyrightyear'] = array(
'rule' => 'copyrightyear',
'message' => isset($LANG_VALIDATION['yearOrRange']) ? $LANG_VALIDATION['yearOrRange'] : $LANG_VALIDATION['default']
@@ -93,17 +96,20 @@
$_CONF_VALIDATE['Core']['rdf_language'] = array('rule' => 'notEmpty');
$_CONF_VALIDATE['Core']['syndication_max_headlines'] = array('rule' => 'numeric');
$_CONF_VALIDATE['Core']['comment_feeds_article_tag'] = array(
- 'sanitize' => 'approveHTML',
- 'rule' => 'notEmpty');
+ 'sanitize' => 'approvedTags',
+ 'rule' => 'notEmpty'
+);
$_CONF_VALIDATE['Core']['comment_feeds_article_tag_position'] = array(
'rule' => array('inList', array('start', 'end', 'none'), true)
);
$_CONF_VALIDATE['Core']['comment_feeds_article_author_tag'] = array(
- 'sanitize' => 'approveHTML',
- 'rule' => 'stringOrEmpty');
+ 'sanitize' => 'approvedTags',
+ 'rule' => 'stringOrEmpty'
+);
$_CONF_VALIDATE['Core']['comment_feeds_comment_author_tag'] = array(
- 'sanitize' => 'approveHTML',
- 'rule' => 'stringOrEmpty');
+ 'sanitize' => 'approvedTags',
+ 'rule' => 'stringOrEmpty'
+);
/* Subgroup Site, Tab Paths */
$_CONF_VALIDATE['Core']['path_html'] = array(
@@ -176,8 +182,9 @@
$_CONF_VALIDATE['Core']['search_show_num'] = array('rule' => 'boolean');
$_CONF_VALIDATE['Core']['search_show_type'] = array('rule' => 'boolean');
$_CONF_VALIDATE['Core']['search_separator'] = array(
- 'sanitize' => 'approveHTML',
- 'rule' => 'string');
+ 'sanitize' => 'approvedTags',
+ 'rule' => 'string'
+);
$_CONF_VALIDATE['Core']['search_def_keytype'] = array(
'rule' => array('inList', array('all', 'any', 'phrase'), true)
);
diff -r 18405a43253d -r fcdb6fe3b76e system/classes/config.class.php
--- a/system/classes/config.class.php Fri Oct 02 13:51:20 2015 -0400
+++ b/system/classes/config.class.php Sat Oct 03 13:16:29 2015 -0400
@@ -1615,45 +1615,6 @@
if ( empty($this->validationErrors) ) {
// only set if there is no validation error
foreach ( $pass_validation as $param => $val ) {
- /*
- if ($group === 'Core') {
- switch ($param) {
- case 'site_name':
- case 'site_slogan':
- case 'owner_name':
- case 'meta_description':
- case 'meta_keywords':
- case 'rdf_language':
- case 'locale':
- case 'date':
- case 'daytime':
- case 'shortdate':
- case 'dateonly':
- case 'timeonly':
- case 'cookie_session':
- case 'cookie_name':
- case 'cookie_password':
- case 'cookie_theme':
- case 'cookie_language':
- case 'cookie_tzid':
- case 'cookie_anon_name':
- $val = strip_tags($val);
- break;
-
- case 'site_disabled_msg':
- case 'comment_feeds_article_tag':
- case 'comment_feeds_article_author_tag':
- case 'comment_feeds_comment_author_tag':
- case 'search_separator':
- $val = COM_checkHTML($val);
- break;
-
- default:
- break;
- }
- }
- */
-
$this->set($param, $val, $group);
$success_array[$param] = true;
}
@@ -1773,11 +1734,15 @@
$default_strip_tags = false;
break;
- case 'approveHTML':
+ case 'approvedTags':
$input_val = COM_checkHTML($input_val);
$default_strip_tags = false;
break;
+ case 'allTags':
+ $default_strip_tags = false;
+ break;
+
default:
break;
}
More information about the geeklog-cvs
mailing list