mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
FIX Bad remote ip address when user is using a proxy
This commit is contained in:
@@ -2636,7 +2636,7 @@ function dol_print_ip($ip, $mode = 0)
|
||||
* Return the IP of remote user.
|
||||
* Take HTTP_X_FORWARDED_FOR (defined when using proxy)
|
||||
* Then HTTP_CLIENT_IP if defined (rare)
|
||||
* Then REMOTE_ADDR (not way to be modified by user but may be wrong if using proxy)
|
||||
* Then REMOTE_ADDR (no way to be modified by user but may be wrong if user is using a proxy)
|
||||
*
|
||||
* @return string Ip of remote user.
|
||||
*/
|
||||
|
||||
@@ -185,10 +185,12 @@ class Stripe extends CommonObject
|
||||
}
|
||||
elseif ($createifnotlinkedtostripe)
|
||||
{
|
||||
$ipaddress = getUserRemoteIP();
|
||||
|
||||
$dataforcustomer = array(
|
||||
"email" => $object->email,
|
||||
"description" => $object->name,
|
||||
"metadata" => array('dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR']))
|
||||
"metadata" => array('dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress)
|
||||
);
|
||||
|
||||
$vatcleaned = $object->tva_intra ? $object->tva_intra : null;
|
||||
|
||||
Reference in New Issue
Block a user