Skip to content

Commit

Permalink
MDL-28392 validate capability names
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 22, 2011
1 parent 6884b59 commit b7d7aaf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b7d7aaf

Please sign in to comment.