Automattic\WooCommerce\Internal\Admin\Orders

PageController::strip_http_referer()privateWC 1.0

Perform a redirect to remove the _wp_http_referer and _wpnonce strings if present in the URL (see also wp-admin/edit.php where a similar process takes place), otherwise the size of this field builds to an unmanageable length over time.

Метод класса: PageController{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->strip_http_referer(): void;

Код PageController::strip_http_referer() WC 8.7.0

private function strip_http_referer(): void {
	$current_url  = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ?? '' ) );
	$stripped_url = remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), $current_url );

	if ( $stripped_url !== $current_url ) {
		wp_safe_redirect( $stripped_url );
		exit;
	}
}