Merge branch 'MDL-36773-23' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE
This commit is contained in:
+1
-1
@@ -1128,7 +1128,7 @@ function clean_param($param, $type) {
|
||||
|
||||
case PARAM_TIMEZONE: //can be int, float(with .5 or .0) or string seperated by '/' and can have '-_'
|
||||
$param = fix_utf8($param);
|
||||
$timezonepattern = '/^(([+-]?(0?[0-9](\.[5|0])?|1[0-3]|1[0-2]\.5))|(99)|[[:alnum:]]+(\/?[[:alpha:]_-])+)$/';
|
||||
$timezonepattern = '/^(([+-]?(0?[0-9](\.[5|0])?|1[0-3](\.0)?|1[0-2]\.5))|(99)|[[:alnum:]]+(\/?[[:alpha:]_-])+)$/';
|
||||
if (preg_match($timezonepattern, $param)) {
|
||||
return $param;
|
||||
} else {
|
||||
|
||||
@@ -979,9 +979,23 @@ class moodlelib_testcase extends advanced_testcase {
|
||||
'0' => '0',
|
||||
'0.0' => '0.0',
|
||||
'0.5' => '0.5',
|
||||
'9.0' => '9.0',
|
||||
'-9.0' => '-9.0',
|
||||
'+9.0' => '+9.0',
|
||||
'9.5' => '9.5',
|
||||
'-9.5' => '-9.5',
|
||||
'+9.5' => '+9.5',
|
||||
'12.0' => '12.0',
|
||||
'-12.0' => '-12.0',
|
||||
'+12.0' => '+12.0',
|
||||
'12.5' => '12.5',
|
||||
'-12.5' => '-12.5',
|
||||
'+12.5' => '+12.5',
|
||||
'13.0' => '13.0',
|
||||
'-13.0' => '-13.0',
|
||||
'+13.0' => '+13.0',
|
||||
'13.5' => '',
|
||||
'+13.5' => '',
|
||||
'-13.5' => '',
|
||||
'0.2' => '');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user