Handle empty parameters in prepared statement execution#230
Conversation
Add check for empty parameters before executing statement. query_prepared() now safely executes queries with no bound params instead of crashing on empty bind_param() types
TheTechsTech
left a comment
There was a problem hiding this comment.
You need to provide something reproducible that will crash.
The query_prepared call allows for $param to be null.
You not fixing any real issue, seems to be creating one instead.
What are you writing that allows it to be or could be null/empty?
Yes you are right, sorry this was an AI fix from a production environment. My bad. Will close. |
TheTechsTech
left a comment
There was a problem hiding this comment.
Ok, I kind of figured that, I didn't really look further.
It just short circuit the whole process with a different query. All the other functions would have detected null.
Another test needs to be added to show that effect. I thought I had a test for that condition, but that actually happened doing inital function developement.
Add check for empty parameters before executing statement. query_prepared() now safely executes queries with no bound params instead of crashing on empty bind_param() types