From df6c00db050e188a6bd5707e72c4f1f331ced923 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 08 Feb 2026 20:46:43 +0000
Subject: [PATCH] =Port over to jakevan 2

---
 inc/rest/PermissionHandler.php |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/inc/rest/PermissionHandler.php b/inc/rest/PermissionHandler.php
index 8d4b447..f59f7c2 100644
--- a/inc/rest/PermissionHandler.php
+++ b/inc/rest/PermissionHandler.php
@@ -343,9 +343,13 @@
 	/**
 	 * Verify action-specific nonce (e.g., 'dash-{user_id}')
 	 */
-	public static function verifyActionNonce(WP_REST_Request $request, string $actionPrefix, string $header = 'action_nonce'): bool|WP_Error
+	public static function verifyActionNonce(WP_REST_Request $request, string $actionPrefix, string $header = 'X-Action-Nonce'): bool|WP_Error
 	{
-		$userId = $request->get_param('user') ?: get_current_user_id();
+		$userId = absint($request->get_param('user'));
+		if ($userId === 0) {
+			return false;
+		}
+
 		$action = $actionPrefix . $userId;
 
 		return self::verifyNonce($request, $action, $header);

--
Gitblit v1.10.0