#22 ending '&' gets an error from google API

v2.x
open
nobody
PHP Proxy (2)
5
2012-10-05
2007-11-09
mrowner
No

When proxy adds '&' to the and of query string for non-cpaint service, that service can give an error "Invalid parameter: ''.".

To fix this we need DO NOT add anding & or dete it like there:

if ($_REQUEST['cpaint_remote_url'] != '') {
$cp_remote_url = urldecode($_REQUEST['cpaint_remote_url']);
$cp_remote_method = urldecode($_REQUEST['cpaint_remote_method']);
//my patch
if(substr($_REQUEST['cpaint_remote_query'],-1) == "&"){
$_REQUEST['cpaint_remote_query'] = substr($_REQUEST['cpaint_remote_query'],0,strlen($_REQUEST['cpaint_remote_query'])-1);
}
//
$cp_remote_query = urldecode($_REQUEST['cpaint_remote_query']);
$cp_response_type = strtoupper($_REQUEST['cpaint_response_type']);
} // end: if

Discussion

  • mrowner
    mrowner
    2007-11-09

    Logged In: YES
    user_id=1933862
    Originator: YES

    I mean: To fix this we need DO NOT add anding & or DELETE it like there...