MDL-28080 coding_exception for over-long placeholder names.

This commit is contained in:
Tim Hunt 2011-07-22 14:22:35 +01:00 committed by Eloy Lafuente (stronk7)
parent 9805fb9f17
commit 8de7858fb9

View File

@ -747,6 +747,11 @@ abstract class moodle_database {
if (!array_key_exists($key, $params)) {
throw new dml_exception('missingkeyinsql', $key, '');
}
if (strlen($key) > 30) {
throw new coding_exception(
"Placeholder names must be 30 characters or shorter. '" .
$key . "' is too long.", $sql);
}
$finalparams[$key] = $params[$key];
}
if ($count != count($finalparams)) {