mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-28392 validate capability names
This commit is contained in:
parent
6884b598f3
commit
b7d7aafada
@ -3395,6 +3395,12 @@ function update_capabilities($component = 'moodle') {
|
||||
$storedcaps = array();
|
||||
|
||||
$filecaps = load_capability_def($component);
|
||||
foreach($filecaps as $capname=>$unused) {
|
||||
if (!preg_match('|^[a-z]+/[a-z_0-9]+:[a-z_0-9]+$|', $capname)) {
|
||||
debugging("Coding problem: Invalid capability name '$capname', use 'clonepermissionsfrom' field for migration.");
|
||||
}
|
||||
}
|
||||
|
||||
$cachedcaps = get_cached_capabilities($component);
|
||||
if ($cachedcaps) {
|
||||
foreach ($cachedcaps as $cachedcap) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user