mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-60281 forms: PHP7.2 deprecations in PEAR
This commit is contained in:
parent
33683bc80c
commit
e3e3e0abb7
@ -71,13 +71,16 @@ class HTML_QuickForm_Rule_Compare extends HTML_QuickForm_Rule
|
||||
function validate($values, $operator = null)
|
||||
{
|
||||
$operator = $this->_findOperator($operator);
|
||||
if ('==' != $operator && '!=' != $operator) {
|
||||
$compareFn = create_function('$a, $b', 'return floatval($a) ' . $operator . ' floatval($b);');
|
||||
$a = $values[0];
|
||||
$b = $values[1];
|
||||
if ($operator == '==') {
|
||||
return $a == $b;
|
||||
} else if ($operator == '!=') {
|
||||
return $a != $b;
|
||||
} else {
|
||||
$compareFn = create_function('$a, $b', 'return $a ' . $operator . ' $b;');
|
||||
// One of: <= , >= , < , > .
|
||||
return eval('return ' . floatval($a) . $operator . floatval($b) . ';');
|
||||
}
|
||||
|
||||
return $compareFn($values[0], $values[1]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -351,14 +351,18 @@ class HTML_QuickForm_date extends HTML_QuickForm_group
|
||||
$this->_options['maxYear'],
|
||||
$this->_options['minYear'] > $this->_options['maxYear']? -1: 1
|
||||
);
|
||||
array_walk($options, create_function('&$v,$k','$v = substr($v,-2);'));
|
||||
array_walk($options, function(&$v, $k) {
|
||||
$v = substr($v, -2);
|
||||
});
|
||||
break;
|
||||
case 'h':
|
||||
$options = $this->_createOptionList(1, 12);
|
||||
break;
|
||||
case 'g':
|
||||
$options = $this->_createOptionList(1, 12);
|
||||
array_walk($options, create_function('&$v,$k', '$v = intval($v);'));
|
||||
array_walk($options, function(&$v, $k) {
|
||||
$v = intval($v);
|
||||
});
|
||||
break;
|
||||
case 'H':
|
||||
$options = $this->_createOptionList(0, 23);
|
||||
|
@ -759,7 +759,7 @@ function _PEAR_call_destructors()
|
||||
$_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
|
||||
}
|
||||
|
||||
while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
|
||||
foreach ($_PEAR_destructor_object_list as $k => $objref) {
|
||||
$classname = get_class($objref);
|
||||
while ($classname) {
|
||||
$destructor = "_$classname";
|
||||
|
@ -32,12 +32,15 @@ MDL-52826 - Remove onsubmit events pointing to the global validation functions a
|
||||
tag moved after the HTML
|
||||
MDL-50484 - _getPersistantData() returns id with _persistant prefixed to element id.
|
||||
MDL-55123 - corrected call to non-static functions in HTML_QuickForm to be PHP7.1-compliant
|
||||
MDL-60281 - replaced deprecated create_function() with lambda functions for PHP7.2 compatibility
|
||||
|
||||
|
||||
Pear
|
||||
====
|
||||
Changed constructors in classes PEAR and PEAR_ERROR to be __construct(). This has
|
||||
been already changed upstream in 1.10.0, remove this line after upgrade.
|
||||
It was decided that we will not upgrade this library from upstream any more, see MDL-52465
|
||||
|
||||
Changed constructors in classes PEAR and PEAR_ERROR to be __construct().
|
||||
MDL-60281 - replaced deprecated function each() with foreach loop for PHP7.2 compatibility
|
||||
|
||||
|
||||
Crypt/CHAP
|
||||
|
Loading…
x
Reference in New Issue
Block a user