[geeklog-cvs] geeklog: Copyright Year in configuration can now accept a year r...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Jan 5 12:20:58 EST 2012


changeset 8471:ce6057508f9a
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/ce6057508f9a
user: Tom <websitemaster at cogeco.net>
date: Thu Jan 05 12:20:27 2012 -0500
description:
Copyright Year in configuration can now accept a year range (bug #0001416)

diffstat:

 language/english.php                           |  1 +
 language/english_utf-8.php                     |  1 +
 public_html/admin/configuration.php            |  2 +-
 public_html/admin/configuration_validation.php |  2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r 981a423aef47 -r ce6057508f9a language/english.php
--- a/language/english.php	Wed Jan 04 10:40:50 2012 -0500
+++ b/language/english.php	Thu Jan 05 12:20:27 2012 -0500
@@ -2150,6 +2150,7 @@
     'comparison' => 'This field does not match the comparison operation',
     'date' => 'This field must be in a date format',
     'year' => 'This field must be in a year format such as 2010',
+    'yearOrRange' => 'This field must be in a year format such as 2010 or range like 2010 - 2012',
     'time' => 'This field must be in a time format',
     'datetime' => 'This field must be in a datetime format',
     'boolean' => 'This field must be a boolean',
diff -r 981a423aef47 -r ce6057508f9a language/english_utf-8.php
--- a/language/english_utf-8.php	Wed Jan 04 10:40:50 2012 -0500
+++ b/language/english_utf-8.php	Thu Jan 05 12:20:27 2012 -0500
@@ -2150,6 +2150,7 @@
     'comparison' => 'This field does not match the comparison operation',
     'date' => 'This field must be in a date format',
     'year' => 'This field must be in a year format such as 2010',
+    'yearOrRange' => 'This field must be in a year format such as 2010 or range like 2010 - 2012',
     'time' => 'This field must be in a time format',
     'datetime' => 'This field must be in a datetime format',
     'boolean' => 'This field must be a boolean',
diff -r 981a423aef47 -r ce6057508f9a public_html/admin/configuration.php
--- a/public_html/admin/configuration.php	Wed Jan 04 10:40:50 2012 -0500
+++ b/public_html/admin/configuration.php	Thu Jan 05 12:20:27 2012 -0500
@@ -135,7 +135,7 @@
 function custom_validation_copyrightyear($rule, $ruleParams) {
     $year = $ruleParams[0]['copyrightyear'];
     
-    return preg_match('/^\d{1,4}$/', $year);
+    return preg_match('/^\d{1,4}\s{0,1}\-{0,1}\s{0,1}\d{0,4}$/', $year);
 }
 
 /**
diff -r 981a423aef47 -r ce6057508f9a public_html/admin/configuration_validation.php
--- a/public_html/admin/configuration_validation.php	Wed Jan 04 10:40:50 2012 -0500
+++ b/public_html/admin/configuration_validation.php	Thu Jan 05 12:20:27 2012 -0500
@@ -44,7 +44,7 @@
 $_CONF_VALIDATE['Core']['site_disabled_msg'] = array('rule' => 'stringOrEmpty');
 $_CONF_VALIDATE['Core']['copyrightyear'] = array(
     'rule' => 'copyrightyear',
-    'message' => isset($LANG_VALIDATION['year']) ? $LANG_VALIDATION['year'] : $LANG_VALIDATION['default']
+    'message' => isset($LANG_VALIDATION['yearOrRange']) ? $LANG_VALIDATION['yearOrRange'] : $LANG_VALIDATION['default']
 );
 $_CONF_VALIDATE['Core']['url_rewrite'] = array('rule' => 'boolean');
 $_CONF_VALIDATE['Core']['cdn_hosted'] = array('rule' => 'boolean');



More information about the geeklog-cvs mailing list