diff --git a/htdocs/product/ajaxproducts.php b/htdocs/product/ajaxproducts.php index 7fb80d54a2a..6bd040b18b0 100644 --- a/htdocs/product/ajaxproducts.php +++ b/htdocs/product/ajaxproducts.php @@ -54,12 +54,16 @@ top_httphead(); //print ''."\n"; -dol_syslog(join(',',$_POST)); +dol_syslog(join(',',$_GET)); -if (! isset($_GET['idprod']) && ! isset($_GET['idprodfournprice'])) return; +$match = preg_grep('/(idprod[0-9]+)/',array_keys($_GET)); +$idprod = $match[6]; // 6eme valeur du GET +//print $_GET[$idprod]; + +if (! isset($_GET['idprod']) && ! isset($_GET[$idprod]) && ! isset($_GET['idprodfournprice'])) return; // When used from jQuery, the search term is added as GET param "term". -$searchkey=$_GET['idprod']?$_GET['idprod']:$_GET['idprodfournprice']; +$searchkey=($_GET[$idprod]?$_GET[$idprod]:($_GET['idprod']?$_GET['idprod']:$_GET['idprodfournprice'])); $outjson=isset($_GET['outjson'])?$_GET['outjson']:0; // Get list of product. @@ -84,4 +88,4 @@ if ($outjson) print json_encode($arrayresult); //print ""; //print ""; -?> +?> \ No newline at end of file