-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Form request object attribute returns empty when have some string #10403
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
Comments
Yes. |
Why string attributes returns empty when is not empty on Laravel Form Request Object? |
When you do |
Hey @beeblebrox3 thx for reply, btw testing this again, work like expected with pure php (5.6):
|
Yeah, sorry about that. Look this gist: https://gist.github.com/beeblebrox3/0b5c2efd176ce3c4370e Technically, |
@GrahamCampbell Look, it's really a Laravel bug. When you do In this case, nether Currently you should "hack" to make it works property, by two ways (but not that it's a workaround):
|
It' isn't laravel bug (yea, it's laravel bug): https://gist.github.com/kneipp/aee5802d08505d605676 [Gist updated] |
Yes, it's. Note that empty() fail on line 16 because you not have defined the method __isset(). And empty() will first try call __isset() and, only if it returns true, __get() will be called. Try to define this method and you will see that __get() will be called as should be expected. |
Yea, we're right it's a laravel bug. |
…results because __isset() is not defined;
[5.1] Fixes issue #10403: empty() over Request returns inconsistent results because __isset() is not defined.
Hello,
Is this correct? I was validating an image when this happens:
#1 ~/work/vila/app/Http/Controllers/FormController.php:53:string 'Screen Shot 2015-09-25 at 06.49.32.png' (length=38)
#2 ~//work/vila/app/Http/Controllers/FormController.php:55:boolean true
#3 ~/work/vila/app/Http/Controllers/FormController.php:55:boolean false
The text was updated successfully, but these errors were encountered: