Index: openacs-4/packages/acs-lang/www/admin/set-system-timezone.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/set-system-timezone.tcl,v diff -u -N -r1.14 -r1.14.2.1 --- openacs-4/packages/acs-lang/www/admin/set-system-timezone.tcl 29 Dec 2017 11:17:34 -0000 1.14 +++ openacs-4/packages/acs-lang/www/admin/set-system-timezone.tcl 16 Jun 2019 13:11:37 -0000 1.14.2.1 @@ -14,7 +14,8 @@ } if { ![lang::system::timezone_support_p] } { - ad_return_error "Timezone support not installed" "This installation of the acs-lang package does not support timezone settings. The ref-timezones package needs to be installed first" + ad_return_error "Timezone support not installed" \ + "This installation of the acs-lang package does not support timezone settings. The ref-timezones package needs to be installed first" ad_script_abort } @@ -55,17 +56,25 @@ # example input: # ss=m3>UTC \(or GMT/Zulu\)-time used: Friday, July 27, 2012 at 19:20:27 -if { [regexp {UTC[^:]+[:][ ]*]*>([^<]+)} $time_and_date_page match utc_from_page] } { +if { [regexp {UTC[^:]+[:][ ]*]*>([^<]+)} \ + $time_and_date_page match utc_from_page] + } { # UTC in format (including some historical ones to help keep a robust regexp: - # Friday, July 27, 2012 at 19:20:27 - # Wednesday, 20 November 2002, at 2:49:07 PM - # Wednesday, 6 August 2003, at 12:11:48 - # this regexp is a little more flexible and accepting of data types to help with parsing - set reg_p [regexp -nocase -- {^([^,]+)[,][ ]+([a-z0-9]+)[ ]+([a-z0-9]+)[,]?[ ]+([a-z0-9]+)[at, ]+[ ]+(.*)$} $utc_from_page match weekday day month year time] + # Friday, July 27, 2012 at 19:20:27 + # Wednesday, 20 November 2002, at 2:49:07 PM + # Wednesday, 6 August 2003, at 12:11:48 + # + # This following regexp is a little more flexible and accepting of + # data types to help with parsing + set reg_p [regexp -nocase -- {^([^,]+)[,][ ]+([a-z0-9]+)[ ]+([a-z0-9]+)[,]?[ ]+([a-z0-9]+)[at, ]+[ ]+(.*)$} \ + $utc_from_page match weekday day month year time] if { $reg_p && [info exists month] && [info exists day] && [info exists year] && [info exists time] } { - # did timeanddate swap day/month? - if { [ad_var_type_check_number_p $month] } { + # + # Did timeanddate swap day/month? If yes then the content of + # variable month is here an integer. + # + if { [string is integer -strict [util::trim_leading_zeros $month]] } { set temp $day set day $month set month $temp