Merge branch 'MDL-39474-master' of git://github.com/sammarshallou/moodle

This commit is contained in:
Dan Poltawski
2013-06-17 15:36:15 +08:00
6 changed files with 20 additions and 3 deletions
+2 -1
View File
@@ -518,8 +518,9 @@ class cache_helper {
* @return string
*/
public static function hash_key($key, cache_definition $definition) {
global $CFG;
if ($definition->uses_simple_keys()) {
if (debugging() && preg_match('#[^a-zA-Z0-9_]#', $key)) {
if ($CFG->developerdebug && preg_match('#[^a-zA-Z0-9_]#', $key)) {
throw new coding_exception('Cache definition '.$definition->get_id().' requires simple keys. Invalid key provided.', $key);
}
// We put the key first so that we can be sure the start of the key changes.