$request->validated and DTOs are both valid responses to mass-assignment vulnerabilities though. Sure, if you validate a field you don't want updated, for example, it will be included in the query, but, and this is the important part, the user does not have control over arbitrarily setting fields.
Same with DTOs. You're creating objects with explicit properties, no user control. If you're using magic to make a DTO automatically from $request->all or something like that, you're doing it wrong.
It doesn't really explain, well, anything. Sure I might have some years of experience now, but I have never once a) not used $fillable; or, b) confused other methods like except for validated.
Your blog post should really dive into what the vulnerability is, how it works, etc., as well as how validated solves it, how safe solves it, and how those two methods are different, to be useful.
Can you elaborate on why you say Junie is a joke? Honestly I've never used anything else, and I don't use it much, but it works well for my needs (mostly writing tests lol). I'm always down to learn about other tools though. Especially if they're cheaper.
static analysis and unit testing are beyond the project
There may be some confusion. You having static analysis and unit test for your framework, does not mean your users have to have it in their projects/uses of the framework. Static analysis and unit tests help you as the developer know that your code works and continues to work as you make changes.
I as a user of your framework would not use it without seeing tests and at least the claim that it meets some static analysis threshold. Without that, how can you be sure, and communicate to others effectively, that it does what it says?
Big note here, based on this: https://github.com/Horlerdipo/simple-otp/blob/main/src/Concerns/GeneratesOtp.php#L31 you are skipping a large portion (actually cryptographically significant) of available numeric codes. Example, if you are generating a length 6 numeric OTP, you are generating from 100000 to 999999, skipping 0 - 99999 entirely.
If your code doesn't check authorization, what does? I agree there are "better" places than others to do it, but we have no context in this question at all.
No and I never claimed to. I was just answering the question posed about what the author meant. I'm not the author, nor do I even agree with the author's methods here.
The last suggestion (timing an app with middleware) is really not the best way to log performance metrics. It also doesn't include any application booting time before this particular middleware runs, or any middleware that runs after it on the response's way back out.
AI detectors are notoriously inaccurate. The article also has enough typos that are consistent with someone who is not a native english speaker that they would have had to use a very specific prompt to get it to be that way.
They say this because Colorado (not the only state) requires job postings to include salaries. So they think by excluding Colorado residents, it makes it ok to not post the salary.
They say this because Colorado (not the only state) requires job postings to include salaries. So they think by excluding Colorado residents, it makes it ok to not post the salary.
$request->validatedand DTOs are both valid responses to mass-assignment vulnerabilities though. Sure, if you validate a field you don't want updated, for example, it will be included in the query, but, and this is the important part, the user does not have control over arbitrarily setting fields.Same with DTOs. You're creating objects with explicit properties, no user control. If you're using magic to make a DTO automatically from
$request->allor something like that, you're doing it wrong.It doesn't really explain, well, anything. Sure I might have some years of experience now, but I have never once a) not used
$fillable; or, b) confused other methods likeexceptforvalidated.Your blog post should really dive into what the vulnerability is, how it works, etc., as well as how
validatedsolves it, howsafesolves it, and how those two methods are different, to be useful.Can you elaborate on why you say Junie is a joke? Honestly I've never used anything else, and I don't use it much, but it works well for my needs (mostly writing tests lol). I'm always down to learn about other tools though. Especially if they're cheaper.
There may be some confusion. You having static analysis and unit test for your framework, does not mean your users have to have it in their projects/uses of the framework. Static analysis and unit tests help you as the developer know that your code works and continues to work as you make changes.
I as a user of your framework would not use it without seeing tests and at least the claim that it meets some static analysis threshold. Without that, how can you be sure, and communicate to others effectively, that it does what it says?
Big note here, based on this: https://github.com/Horlerdipo/simple-otp/blob/main/src/Concerns/GeneratesOtp.php#L31 you are skipping a large portion (actually cryptographically significant) of available numeric codes. Example, if you are generating a length 6 numeric OTP, you are generating from 100000 to 999999, skipping 0 - 99999 entirely.
I agree there, I'm just not sure how the original comment or that one is really relevant to the conversation.
If your code doesn't check authorization, what does? I agree there are "better" places than others to do it, but we have no context in this question at all.
No and I never claimed to. I was just answering the question posed about what the author meant. I'm not the author, nor do I even agree with the author's methods here.
It means that, in the future, if your project uses this patch, it will continue to work in L13 as well, as long as the patch info remains the same.
Also, I'd just like to point out that, as written, they do not do the same thing.
Closure::...passes a closure instance tocolor.->color($this->...)passes the return value ofgetStateColortocolorWhat are some of your biggest issues? The "real" problems you want to see fixed?
The last suggestion (timing an app with middleware) is really not the best way to log performance metrics. It also doesn't include any application booting time before this particular middleware runs, or any middleware that runs after it on the response's way back out.
AI detectors are notoriously inaccurate. The article also has enough typos that are consistent with someone who is not a native english speaker that they would have had to use a very specific prompt to get it to be that way.
sorry, it might just be the time I'm reading this, but what exactly is wrong with the snippet you posted?
And to keep going on that, you don't even need a private property with a getter, you can shorten it down to asymetric visibility.
I would look into adding a new locale to https://github.com/FakerPHP/Faker to get a wider reach.
That only works if you actually have a typeface that supports ligatures.
Guess we should change this sub's name too then!
It implements the pusher protocol so it is compatible with existing pusher clients. It doesn't actually need a pusher account.
What was the salary range?
They say this because Colorado (not the only state) requires job postings to include salaries. So they think by excluding Colorado residents, it makes it ok to not post the salary.
They say this because Colorado (not the only state) requires job postings to include salaries. So they think by excluding Colorado residents, it makes it ok to not post the salary.
Why in the world are you calling
-Syyumultiple times a day?? You shouldn't passyyunless you have good reason to.Which hasn't been updated since 2015 and PHP 5... I think they forgot themselves.
Unless you provide some proof of that, I think you're full of shit. This is terrible advice.