diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index a189781c8c1..7fe3c835f18 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -31,9 +31,8 @@ define("NOLOGIN",1); // This means this output page does not require to be logg define("NOCSRFCHECK",1); // We accept to go on this page from external web site. // For MultiCompany module. -// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php -// TODO This should be useless. Because entity must be retreive from object ref and not from url. -$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : (! empty($_GET['e']) ? (int) $_GET['e'] : (! empty($_POST['e']) ? (int) $_POST['e'] : 1)))); if (is_numeric($entity)) define("DOLENTITY", $entity); require '../../main.inc.php';