-
Bug
-
Resolution: Fixed
-
Minor
-
2.4.5, 2.5, 2.6
-
MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
wip-
MDL-40700-m26 -
When configuring a memcache store, the key prefix field allows the user to submit numbers, and save the changes.
Because the form definition uses ALPHAEXT for this field, the numbers are stripped out silently.
A simple fix is to change the field type to ALPHANUMEXT, and add some form validation.
diff --git a/cache/stores/memcache/addinstanceform.php b/cache/stores/memcache/addinstanceform.php
|
index 984966a..29e1239 100644
|
--- a/cache/stores/memcache/addinstanceform.php
|
+++ b/cache/stores/memcache/addinstanceform.php
|
@@ -49,7 +49,7 @@ class cachestore_memcache_addinstance_form extends cachestore_addinstance_form {
|
$form->addElement('text', 'prefix', get_string('prefix', 'cachestore_memcache'),
|
array('maxlength' => 5, 'size' => 5));
|
$form->addHelpButton('prefix', 'prefix', 'cachestore_memcache');
|
- $form->setType('prefix', PARAM_ALPHAEXT);
|
+ $form->setType('prefix', PARAM_ALPHANUMEXT);
|
$form->setDefault('prefix', 'mdl_');
|
}
|
Is there a reason behind not allowing numeric prefixes? With a 5 character limit, very few sites can use the same memcache servers, and have meaningful key prefixes.
- Discovered while testing
-
MDLSITE-2356 Reduce the skipped tests in CI servers
-
- Closed
-