From 0468fbf9120a641659c2be55262a27d82cf0c737 Mon Sep 17 00:00:00 2001 From: Nikola Mijajlovic Date: Mon, 22 Jun 2026 15:28:33 +0200 Subject: [PATCH] Fix: guard REQUESTS_SILENCE_PSR0_DEPRECATIONS define to prevent constant collision Unconditional define() causes a fatal error when the constant is already defined by the host environment (e.g. WordPress core defines it in its bundled Requests library before the Composer autoloader runs). Razorpay.php in the same package already uses this guard correctly; align Deprecated.php to match. Fixes #415 --- Deprecated.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deprecated.php b/Deprecated.php index ca439da7..0c712d3a 100644 --- a/Deprecated.php +++ b/Deprecated.php @@ -11,7 +11,7 @@ * * @deprecated 2.0.4 Use the PSR-4 class names instead. */ -define("REQUESTS_SILENCE_PSR0_DEPRECATIONS",true); +if (!defined("REQUESTS_SILENCE_PSR0_DEPRECATIONS")) define("REQUESTS_SILENCE_PSR0_DEPRECATIONS", true); if (class_exists('WpOrg\Requests\Autoload') === false) { require_once __DIR__. 'libs/Requests-2.0.4/src/Autoload.php';