Home  |  Linux  | Mysql  | PHP  | XML
From:George Langley Date:Fri Mar 12 00:34:28 2010
Subject:Re: $_GET is Mangling Base64 value
Hi again. Thanks for all the info!
Not sure I'd agree that GET should just "assume" it was URLencode As mentioned, this is eventually buried into a Joomla! site's login functions (displays any errors). So not sure I'd have access to the originating call to URLencode it before sending, if it's part of the standard Joomla! login function and not some of our custom code.
However, Mike's suggestion to "pre-parse" it at our end:

$_GET['foo'] = str_replace(' ', '+', $_GET['foo']);

appears to work fine. I put the above in in just before the GET in my bare-bones PHP-only test, and in the actual Joomla! page just before their equivalent call:

echo base64_decode(JRequest::getVar('message', '', 'method', 'base64'));

Have tested it with strings that also included a / (being the other non-alphanumeric character that Base64 uses), and it remains unaffected.
So, guess I can either add the pre-parse wherever I need to, or try to locate the call to see if I can urlencode it (and who am I to argue why they didn't do that too?!)
Thanks again.

George

Navigate in group php.general at sever news.php.net
Previous Next


Your recent visits
Re: [PHP] DOMElement: td vs. th
SSL and multiple host names
Re: [PHP] web sniffer
web sniffer
Re: [PHP] Re: PHP in HTML code



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants