Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

!bug: invalid reference skips author setting

If there is an invalid reference in ZAML file, like

   foo: bar
  new_user: @invalid_user
   foo: not_bar

then any setting for "new_user" will be ignored. Actually,
the reference line is skipped, so "new_user" will have not
any setting, while "some_user" (whose settings are above
the reference line) will accept non-wanted settings, so

    foo: bar
    foo: not_bar

and finally, the "some_user" will use "not_bar" for "foo".

In pratice, this may be considered as a "feature", because
in ZAML any invalid line is meanless and used by the last
user. However, that is very confused thing. Let see this
example: The "some_user" belongs to the group "~moderator",
and we have in ZAML

    edit_image_of: any
  new_user: @some_user

People may think this works. But it is not. This is because
the referene "@some_user" doesn't expand at the time ZAML
file is parsed (this is natural; the parser shouldn't depend
on any back-end stuff).

In this fix, we make sure that an invalid referene lince
will not skip author setting. We do not fix expansion issue.
  • Loading branch information...
commit c4797c91ae94b493e6df7fcfd4e51cddcadde7c1 1 parent e701997
@icy authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 include/
6 include/
@@ -407,13 +407,13 @@ function icy_zml_parser($data) {
if (preg_match('/^([^[:space:]:]+):[[:space:]]+@([^[:space:]:]+)$/', $line, $gs)) {
$ref_author = trim($gs[2]);
- if (!array_key_exists($ref_author, $acl)) {
- continue;
- }
$author = trim($gs[1]);
if (! array_key_exists($author, $acl)) {
$acl[$author] = array();
+ if (!array_key_exists($ref_author, $acl)) {
+ continue;
+ }
$acl[$author] = array_replace($acl[$ref_author], $acl[$author]);

0 comments on commit c4797c9

Please sign in to comment.
Something went wrong with that request. Please try again.