| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Code Climate has analyzed commit a282d76 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (80% is the threshold). This pull request will bring the total coverage in the repository to 97.6% (0.0% change). View more on Code Climate. |
Sorry, something went wrong.
| public function testStringsMustNotEvaluateAsCallables(): void | ||
| { | ||
| $message = 'Hello, {firstName} {lastName}!'; | ||
| $expected = 'Hello, Ceil Floor!'; |
There was a problem hiding this comment.
👋 😄
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
We've encountered some cases where the string values "max," "floor," and "tan" were passed as values to replace placeholders in formatted messages. However, since we were doing an is_callable() check on the strings, and PHP has functions with these names, FormatPHP was attempting to call the functions instead of treating them as strings that should replace the placeholders.
Since we should never call a function that is potentially provided from user input, we will disallow the use of string callables. Only array callables and Closures are allowed.
Product requirements and context
How has this been tested?
PR Checklist