Changeset 3462956
- Timestamp:
- 02/16/2026 10:26:07 PM (4 days ago)
- Location:
- ai-translate
- Files:
-
- 2 edited
-
tags/2.2.8/ai-translate.php (modified) (1 diff)
-
trunk/ai-translate.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ai-translate/tags/2.2.8/ai-translate.php
r3462708 r3462956 1235 1235 return true; 1236 1236 } 1237 1238 // Public frontend pages can be heavily cached, causing stale inline nonces. 1239 // Allow anonymous same-site requests without requiring a valid nonce. 1240 if (!is_user_logged_in()) { 1241 $origin = isset($_SERVER['HTTP_ORIGIN']) ? (string) $_SERVER['HTTP_ORIGIN'] : ''; 1242 if ($origin !== '' && strpos($origin, home_url()) !== 0) { 1243 return new \WP_Error('rest_forbidden', 'Invalid origin', ['status' => 403]); 1244 } 1245 return true; 1246 } 1247 1237 1248 return new \WP_Error('rest_forbidden', 'Invalid nonce', ['status' => 403]); 1238 1249 }, -
ai-translate/trunk/ai-translate.php
r3462699 r3462956 1235 1235 return true; 1236 1236 } 1237 1238 // Public frontend pages can be heavily cached, causing stale inline nonces. 1239 // Allow anonymous same-site requests without requiring a valid nonce. 1240 if (!is_user_logged_in()) { 1241 $origin = isset($_SERVER['HTTP_ORIGIN']) ? (string) $_SERVER['HTTP_ORIGIN'] : ''; 1242 if ($origin !== '' && strpos($origin, home_url()) !== 0) { 1243 return new \WP_Error('rest_forbidden', 'Invalid origin', ['status' => 403]); 1244 } 1245 return true; 1246 } 1247 1237 1248 return new \WP_Error('rest_forbidden', 'Invalid nonce', ['status' => 403]); 1238 1249 },
Note: See TracChangeset
for help on using the changeset viewer.