Skip to content

Commit

Permalink
decode JSON on empty string should not raise exception
Browse files Browse the repository at this point in the history
  • Loading branch information
HonkDerHase committed Jan 10, 2025
1 parent ecfd841 commit 32857fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/ProxyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function createGooglePayOrder()
$this->setPayPalPaymentMethod($paymentId);
$basket = Registry::getSession()->getBasket();

if ($basket && $basket->getItemsCount() === 0) {
if ($basket->getItemsCount() === 0) {
$this->outputJson(['ERROR' => 'No Article in the Basket']);
}

Expand Down Expand Up @@ -231,7 +231,7 @@ public function createGooglePayOrder()
*/
public function approveOrder()
{
$data = json_decode(file_get_contents('php://input'), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode(file_get_contents('php://input'), true);
$orderId = (string) Registry::getRequest()->getRequestEscapedParameter('orderID');
$sessionOrderId = PayPalSession::getCheckoutOrderId();
if (!empty($data['orderID']) && $orderId === '') {
Expand Down

0 comments on commit 32857fe

Please sign in to comment.