From 24864aa372da2fd634b2ed9d4c4b13ea33afbb6c Mon Sep 17 00:00:00 2001 From: Imants Date: Sat, 20 Jun 2026 18:25:50 +0300 Subject: [PATCH] fix: prevent assert string evaluation in REST controller on PHP 7 --- src/php/REST_API/REST_Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/php/REST_API/REST_Controller.php b/src/php/REST_API/REST_Controller.php index add423168..0995706bf 100644 --- a/src/php/REST_API/REST_Controller.php +++ b/src/php/REST_API/REST_Controller.php @@ -36,7 +36,7 @@ abstract class REST_Controller { */ public function __construct() { assert( static::VERSION > 0, get_class( $this ) . '::VERSION must be set' ); - assert( static::BASE_ROUTE, get_class( $this ) . '::BASE_ROUTE must be set' ); + assert( static::BASE_ROUTE !== '', get_class( $this ) . '::BASE_ROUTE must be set' ); $this->namespace = REST_API_NAMESPACE . static::VERSION; add_action( 'rest_api_init', [ $this, 'register_routes' ] );