Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6884b59
)
MDL-28392 validate capability names
author
Petr Skoda
<commits@skodak.org>
Fri, 22 Jul 2011 22:05:25 +0000
(
00:05
+0200)
committer
Petr Skoda
<commits@skodak.org>
Fri, 22 Jul 2011 22:09:08 +0000
(
00:09
+0200)
lib/accesslib.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/accesslib.php
b/lib/accesslib.php
index
f56aecb
..
44b87ee
100644
(file)
--- a/
lib/accesslib.php
+++ b/
lib/accesslib.php
@@
-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) {