MDL-29894 forbid objects in DML parameters

Objects with __toString we never fully supported as parameters in DML layer, this finally brings consistent behaviour.
This commit is contained in:
Petr Skoda 2012-03-17 18:42:30 +01:00
parent a2b30aa852
commit e618cdf3f6
8 changed files with 156 additions and 4 deletions

View file

@ -579,6 +579,8 @@ class sqlsrv_native_moodle_database extends moodle_database {
* @return mixed the normalised value
*/
protected function normalise_value($column, $value) {
$this->detect_objects($value);
if (is_bool($value)) { /// Always, convert boolean to int
$value = (int)$value;
} // And continue processing because text columns with numeric info need special handling below