mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-20245 grade: increased the length of the user_preferences::value column and added an exception to set_user_preference() is this new length is exceeded
Conflicts: lib/db/upgrade.php version.php
This commit is contained in:
parent
c42346aa63
commit
8e54ce9717
4 changed files with 19 additions and 3 deletions
|
@ -1652,6 +1652,9 @@ function set_user_preference($name, $value, $user = null) {
|
|||
throw new coding_exception('Invalid value in set_user_preference() call, arrays are not allowed');
|
||||
}
|
||||
$value = (string)$value;
|
||||
if (textlib::strlen($value) > 1333) { //value column maximum length is 1333 characters
|
||||
throw new coding_exception('Invalid value in set_user_preference() call, value is is too long for the value column');
|
||||
}
|
||||
|
||||
if (is_null($user)) {
|
||||
$user = $USER;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue