Member
Member
BigLouis87   2012-09-26, 01:02
#1

I have to pass a username via a GET request and then take it to load a user_obj:
$user_obj = Zenphoto_Authority::getAnAdmin(array('user=' => $getuser));
The problem rises when I try to pass a username with some spaces inside, the function cannot get any admin.
Any ideas how to solve it?
Thanks

Member
Member
sbillard   2012-09-27, 03:48
#2

Don't know, certainly works for me. Are you sure you have things like case and such correct? Maybe display the $getuser to be sure it is what you think. For instance if it came from a URL the space might be a plus sign.

Member
Member
BigLouis87   2012-09-29, 18:37
#3

I solved with a $getuser = str_replace("%20"," ",$getuser);

Member
Member
sbillard   2012-09-29, 20:10
#4

Ok, so somehow the user name was encoded but not decoded. That would of course be open to all sorts of problems, not just spaces, but of course that depends on the actual user ids themselves.

Best you find where you are retrieving that user name and insure it is properly handled, both in encoding and decoding.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.