-
Notifications
You must be signed in to change notification settings - Fork 583
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
After upgrading to 5.1.0: Strings with null bytes cannot be escaped. Use the binary escape option. #1489
Comments
I encountered similar issues through any small Model update that made Revisionable call Telescope and fail on it as a Datetime somehow ended up in the |
@morloderex could you provide a fix for this? Otherwise we'll have to revert that PR. |
@driesvints Sorry for the late answer! @tpetry can you elaborate a bit more on why you didn't choose get and implement the binary flag for parameter bindings? |
Just wanted to chime in that I also noticed this same bug. It was causing our develop database to max connections and eventually crash our vapor environment. |
@morloderex There's currently no way in eloquent to provide flags or hints for parameter bindings. The correct way would be to add a |
I reverted this PR for now to unblock people. @morloderex would love a new PR but with the things people mentioned here in mind. |
Guys the tool is not the problem. It is the older 5.x Laravel code that allowed us to create functions and variables without considering any NULL values for variables or columns within our code calls. so if you had say public function columbus($user, Request $requedst) You are to redo it like this.. public function columbus($user = null, Request $requedst) and so forth and so on... In the older Laravel versions we can say $variable = "a value"; but if it is inside an if statement if (my_condition){ it is not defined at all unless the condition is met so the tool will evaluate it as a string with null bytes instead of a binary with null bytes when it tries to evaluate a condition that was not sent to the function. You can't expect the tool to do everything for you. In my case I noticed that another tool I used called Pulse, was using the old way of code writing and was giving a crapload of the same error until I checked their code. I simply stop using it and voila.. My point, check your code, validate your data and make sure your variables are pre-defined with null if you need it to be that. A lot of bool vars can be 0 or 1 as well. Anyway, just my 2¢ Johnny |
To be honest: I dont get your point. At least for my usecase I did not have undefined vars. if you check my code in the initial post, I dont see any undefined vars at all. |
Telescope Version
5.1.0
Laravel Version
11
PHP Version
8.3
Database Driver & Version
MariaDB
Description
After upgrading laravel/telescope to 5.1.0, I am getting a RuntimeException:
The code that causes this is the following:
The change that introduced this behavior is this: https://github.com/laravel/telescope/pull/1486/files#diff-397191004b8c1dbda4835ec7eda183402511fcb376c12796072958be5ead9f0c
Pinning telescope to 5.0.5 solves the issue for now.
Steps To Reproduce
Create a new Laravel project and use tinker(well) to run this code:
The text was updated successfully, but these errors were encountered: