New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix useless use of $auth->isCaseSensitive() in auth_aclcheck() #146
Conversation
ACL matching of DokuWiki is currently always case-sensitive regardless of auth backend setting ($auth->isCaseSensitive). This commit enables case-insensitive matching in the same way of auth_isMember().
That isn't true. The current code uses a case insensitive RegEx (the "i" flag). see http://php.net/manual/en/function.preg-match.php Example 1. |
Reopened, since I guess @kazmiya was trying to fix a problem he had here. I could imagine that preg_match's idea of case insensitivity differs from what a utf8_strtolower does. Especially when non-ASCII chars are involved and the PREG module is missing some compile time options... @kazmiya can you please provide some more details why the original code fails for you? A unit test would be helpful as well. |
From looking at the code I get the impression that we matched the id of the page case-insensitively against the ACL rules when the authentication system indicated that the user/group should be matched case-insensitively. The comparison of the group/user happens not in the regular expression but later in the For me this looks good, I vote for merging though having unit tests would be great of course. |
@michitux correctly explained what I was thinking about. The The problem is:
But after I submitted this pull request, I noticed that I should give special consideration for the i.e. I guess this line... if(!$auth->isCaseSensitive()) $acl[1] = utf8_strtolower($acl[1]); should be: if(!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
$acl[1] = utf8_strtolower($acl[1]);
} ( Any ideas? |
sorry didn't see that last night ;-) |
I think this exception for |
Closed. Please see #147. |
* master: media fields need unique IDs. fixes #152 fixed references to old Integer type removed Integer type Version upped fixed problem with multicolumns and made the param name clearer added missing schema file when Page uses titles, sorting should use title #146 Decimal type needs to type cast for order and compare #146 make sure pages are assigned in tests give types a way to influence sorting Version upped diff needs to compare raw values test wildcard adding in Search
* master: output the key not value for unknown option in ConfigParser media fields need unique IDs. fixes #152 fixed references to old Integer type removed Integer type Version upped fixed problem with multicolumns and made the param name clearer added missing schema file when Page uses titles, sorting should use title #146 Decimal type needs to type cast for order and compare #146 make sure pages are assigned in tests give types a way to influence sorting add slight shadow for aggregation images Fixed multi fields for inline editor test wildcard adding in Search
ACL matching of DokuWiki is currently always case-sensitive
regardless of auth backend setting ($auth->isCaseSensitive).
These commits enable case-insensitive matching in the same way
of auth_isMember().