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

Variables are not being escaped for with() #135

Merged

Conversation

elliotchance
Copy link
Owner

$this->mock('MyClass')
     ->expect('myMethod')->with('a$b')
     ->done();

$b is not escaped so evaluating it will cause an error - fix:

$args = str_replace('$', '\\$', addslashes(json_encode($rule['with'])));

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 4a92712 on 1.2.2/135-variables-are-not-being-escaped-for-with into d884c7a on release/1.2.2.

@scrutinizer-notifier
Copy link

The inspection completed: No new issues

elliotchance added a commit that referenced this pull request Aug 13, 2014
…-being-escaped-for-with

Variables are not being escaped for with()
@elliotchance elliotchance merged commit 5a752ad into release/1.2.2 Aug 13, 2014
@elliotchance elliotchance deleted the 1.2.2/135-variables-are-not-being-escaped-for-with branch August 13, 2014 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants