Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-28080 coding_exception for over-long placeholder names.

  • Loading branch information...
commit a167057d58c89344ed4b3d8d1439787ca68cce1e 1 parent 15141ad
@timhunt timhunt authored stronk7 committed
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/dml/moodle_database.php
View
5 lib/dml/moodle_database.php
@@ -727,6 +727,11 @@ public function fix_sql_params($sql, array $params=null) {
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)) {
Please sign in to comment.
Something went wrong with that request. Please try again.