mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
MDL-40700 cache: Validate memcache key prefix field
This commit is contained in:
parent
ffc3f5308b
commit
a423acd95c
3
cache/stores/memcache/addinstanceform.php
vendored
3
cache/stores/memcache/addinstanceform.php
vendored
@ -49,7 +49,8 @@ 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->addRule('prefix', get_string('storeprefixinvalid', 'cache'), 'regex', '#^[a-zA-Z0-9\-_ ]+$#');
|
||||
$form->setType('prefix', PARAM_TEXT);
|
||||
$form->setDefault('prefix', 'mdl_');
|
||||
}
|
||||
}
|
@ -141,6 +141,7 @@ $string['storename_help'] = 'This sets the store name. It is used to identify th
|
||||
$string['storenamealreadyused'] = 'You must choose a unique name for this store.';
|
||||
$string['storenameinvalid'] = 'Invalid store name. You can only use a-z A-Z 0-9 -_ and spaces.';
|
||||
$string['storeperformance'] = 'Cache store performance reporting - {$a} unique requests per operation.';
|
||||
$string['storeprefixinvalid'] = 'Invalid store prefix. You can only use a-z A-Z 0-9 -_ and spaces.';
|
||||
$string['storeready'] = 'Ready';
|
||||
$string['storenotready'] = 'Store not ready';
|
||||
$string['storerequiresattention'] = 'Requires attention.';
|
||||
|
Loading…
x
Reference in New Issue
Block a user