Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-28080 coding_exception for over-long placeholder names.

  • Loading branch information...
commit 41f17b384fcf779d7c5cb21bbc6f81ae363ff7c4 1 parent ddf3225
@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
@@ -747,6 +747,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.