Support the ongoing development of Laravel.io →
Requests Input Validation

i tried validate (following validator docs ) using regex but didnt' work...need i to do something more? if i pass them encoded using postman manually, "%20" ect ect, the request works and the following store query has been stored correctly into db (mysql utf8). Surely i'm missing some basics here ...could a gentle soul helping me understanding what i'm missing?

example error log: at Builder->__call('insertGetId', array(array('form_id' => '0', 'label_code' => '5555777', 'field_code' => '324232', 'field_value' => '', 'user_id' => null, 'date_updated' => null), 'data_id')) in Model.php line 1638

field_value variable got void , i tried to pass it as " #0122" " ,previous values are passed correctly, following are ignored and set to null

generating url is: http://website/insert?form_id=0&label_code=5555777&field_code=324232&field_value=#0122"&user_id=2222&date_updated=2002-12-3

it's like symbol # breaks the url in some way. why?

Last updated 3 years ago.
0

symbol is usually used to create a link on the same page.

if you really need it one way would be to try and use urlencode() & see what it does.. another way would be to replace with some obscure character and then replace it back..

0

problem seems to be in how Request parsing array once found # the following is missing

$url = $request->all(); returns: {"form_id":"0","label_code":"5555777","field_code":"324232","field_value":""}

the request array is "truncated" at # so i can urlencode only what before # ...

I know i should encode it on app that sends the request, that would be best practice as for security also, but i cannot access that code at moment and i have to manage from laravel side ... so they must have "freedom" to send any special char in values, and while " or even = symbols give no problem at all only # is causing troubles...is that char so special? does it have any particular need I'm missing ?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

alko79 alko79 Joined 12 Jul 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.