|
Server : Apache System : Linux s1230 5.15.0-139-generic #149~20.04.1 SMP Tue Jul 14 11:21:49 UTC 2026 x86_64 User : p141464 ( 418825) PHP Version : 7.4.33.12 Disable Function : NONE Directory : /html/relaunch-kmu/wp-content/plugins/imagify/vendor/wp-media/mcp-oauth/inc/Auth/ |
Upload File : |
<?php
/**
* Shared 404 helper for OAuth request handlers.
*/
declare( strict_types=1 );
namespace WPMedia\MCP\OAuth\Auth;
/**
* Provides a clean 404 response for stale OAuth/discovery rewrite rules.
*/
trait Http404Trait {
/**
* Force a clean 404 response.
*
* Used when a stale rewrite rule still routes a request to an OAuth or
* discovery endpoint after the OAuth server has been disabled, before
* rewrite rules have been flushed. Without this, WordPress's main query
* would fall through to the homepage instead of returning a 404.
*
* @return void
*/
private function force_404(): void {
global $wp_query;
$wp_query->set_404();
status_header( 404 );
}
}