MDL-28080 coding_exception for over-long placeholder names.

This commit is contained in:
Tim Hunt
2011-09-01 19:59:12 +02:00
committed by Eloy Lafuente (stronk7)
parent ddf322586e
commit 41f17b384f
+5
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)) {