forked from Wavyzz/dolibarr
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.
|
* Return the IP of remote user.
|
||||||
* Take HTTP_X_FORWARDED_FOR (defined when using proxy)
|
* Take HTTP_X_FORWARDED_FOR (defined when using proxy)
|
||||||
* Then HTTP_CLIENT_IP if defined (rare)
|
* 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.
|
* @return string Ip of remote user.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -185,10 +185,12 @@ class Stripe extends CommonObject
|
|||||||
}
|
}
|
||||||
elseif ($createifnotlinkedtostripe)
|
elseif ($createifnotlinkedtostripe)
|
||||||
{
|
{
|
||||||
|
$ipaddress = getUserRemoteIP();
|
||||||
|
|
||||||
$dataforcustomer = array(
|
$dataforcustomer = array(
|
||||||
"email" => $object->email,
|
"email" => $object->email,
|
||||||
"description" => $object->name,
|
"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;
|
$vatcleaned = $object->tva_intra ? $object->tva_intra : null;
|
||||||
|
|||||||
Reference in New Issue
Block a user