From b9954f5b2b041aaa5b19e918bf5925b0b5404be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= <rdoursenaud@gpcsolutions.fr> Date: Tue, 16 Sep 2014 15:17:43 +0200 Subject: [PATCH] PHP 5.6 compatibility $HTTP_RAW_POST_DATA is now DEPRECATED Replaced all usages by the recommended file_get_contents("php://input") --- dev/skeletons/skeleton_webservice_server.php | 3 +-- htdocs/webservices/server_actioncomm.php | 2 +- htdocs/webservices/server_category.php | 4 +--- htdocs/webservices/server_contact.php | 4 ++-- htdocs/webservices/server_invoice.php | 4 +--- htdocs/webservices/server_order.php | 4 +--- htdocs/webservices/server_other.php | 3 +-- htdocs/webservices/server_productorservice.php | 5 +---- htdocs/webservices/server_supplier_invoice.php | 4 +--- htdocs/webservices/server_thirdparty.php | 2 +- htdocs/webservices/server_user.php | 4 +--- 11 files changed, 12 insertions(+), 27 deletions(-) diff --git a/dev/skeletons/skeleton_webservice_server.php b/dev/skeletons/skeleton_webservice_server.php index 278057fd4f6..52bb46455cb 100644 --- a/dev/skeletons/skeleton_webservice_server.php +++ b/dev/skeletons/skeleton_webservice_server.php @@ -269,5 +269,4 @@ function createSkeleton($authentication,$skeleton) } // Return the results. -$server->service($HTTP_RAW_POST_DATA); - +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index dfc0aac590a..d5d9c45fa36 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -590,4 +590,4 @@ function updateActionComm($authentication,$actioncomm) } // Return the results. -$server->service($HTTP_RAW_POST_DATA); +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index 1b85c677175..3c723947764 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -298,7 +298,5 @@ function getCategory($authentication,$id) return $objectresp; } - // Return the results. -$server->service($HTTP_RAW_POST_DATA); - +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 672f90a7bd1..f42c270fa42 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -712,6 +712,6 @@ function updateContact($authentication,$contact) return $objectresp; } -// Return the results. -$server->service($HTTP_RAW_POST_DATA); +// Return the results. +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index e8c6f166890..d0f3e589f25 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -587,7 +587,5 @@ function createInvoice($authentication,$invoice) return $objectresp; } - // Return the results. -$server->service((isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:'')); - +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index d70725b468f..387ed548506 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -798,7 +798,5 @@ function validOrder($authentication,$id='') return $objectresp; } - // Return the results. -$server->service((isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:'')); - +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 0e3caa512c6..ba948d463ea 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -321,5 +321,4 @@ function getDocument($authentication, $modulepart, $file, $refname='') } // Return the results. -$server->service($HTTP_RAW_POST_DATA); - +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 3e50060660c..ffe25f8e3e8 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -1019,8 +1019,5 @@ function getProductsForCategory($authentication,$id,$lang='') return $objectresp; } - - // Return the results. -$server->service($HTTP_RAW_POST_DATA); - +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index c6697980a12..fea871ac077 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -457,7 +457,5 @@ function getSupplierInvoicesForThirdParty($authentication,$idthirdparty) return $objectresp; } - // Return the results. -$server->service($HTTP_RAW_POST_DATA); - +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 645e120a101..301511e0115 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -728,4 +728,4 @@ function getListOfThirdParties($authentication,$filterthirdparty) } // Return the results. -$server->service($HTTP_RAW_POST_DATA); +$server->service(file_get_contents("php://input")); diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 96fcde097b2..4fb5cc81e8c 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -753,7 +753,5 @@ function setUserPassword($authentication,$shortuser) { return $objectresp; } - // Return the results. -$server->service($HTTP_RAW_POST_DATA); - +$server->service(file_get_contents("php://input")); -- GitLab