Skip to content
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

Bug in checking private variables. #3

Merged
merged 2 commits into from
Apr 3, 2012
Merged

Bug in checking private variables. #3

merged 2 commits into from
Apr 3, 2012

Conversation

cdburgess
Copy link
Contributor

Private variables require double underscore (__), however the isValidVar does not account for private variables. It only allows for protected variables with a single underscore. This will resolve the private variable check by changing the number of characters to remove from the beginning of the string before checking legalChars.

Private variables require double underscore (__), however the
isValidVar does not account for private variables. It only allows for
protected  variables with a single underscore. This will resolve the
private variable check.
@markstory
Copy link
Member

What's going on with the whitespace? Also I don't see where $firstStringCount is used, how does that change work?

Updated the usage for $firstStringCount
@cdburgess
Copy link
Contributor Author

Added $firstStringCount on line 280 where it is removing the first character. The issue is if you pass a private variable here, it will leave a leading underscore and give you an error indicating it does not match the camel case.

I updated line 280 so it would reflect the change for $firstStringCount

if (preg_match("|[^$legalChars]|", substr($string, $firstStringCount)) > 0) {

markstory added a commit that referenced this pull request Apr 3, 2012
Bug in checking private variables.
@markstory markstory merged commit f4d3957 into cakephp:master Apr 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants