mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDLSITE-1007 ugly workaround for preventing of sloppy string to int casting in mysql
This commit is contained in:
parent
422b75a712
commit
70ff13bed7
@ -610,8 +610,8 @@ class mysqli_native_moodle_database extends moodle_database {
|
||||
$return .= (int)$param;
|
||||
} else if (is_null($param)) {
|
||||
$return .= 'NULL';
|
||||
} else if (is_number($param)) { // we can not use is_numeric() because it eats leading zeros from strings like 0045646
|
||||
$return .= $param;
|
||||
} else if (is_number($param)) {
|
||||
$return .= "'".$param."'"; // we have to always use strings because mysql is using weird automatic int casting
|
||||
} else if (is_float($param)) {
|
||||
$return .= $param;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user