Yoast\WP\SEO\MyYoast_Client\User_Interface
Management_Route::resolve_return_url
Validates a caller-supplied return URL against the site's own host.
The return URL is optional: callers that have nowhere meaningful to send the user back to omit it. Anything off-site or otherwise invalid is treated as absent rather than rewritten to a default — wp_validate_redirect() an empty fallback yields an empty string, which we normalize to null. The callback re-validates the stored value before redirecting, so this is the first of two gates against an open redirect.
Метод класса: Management_Route{}
Хуков нет.
Возвращает
string|null. The validated same-host URL, or null when none applies.
Использование
// private - только в коде основоного (родительского) класса $result = $this->resolve_return_url( ?string $return_url ): ?string;
- ?string $return_url(обязательный)
- .
Код Management_Route::resolve_return_url() Management Route::resolve return url Yoast 28.9
private function resolve_return_url( ?string $return_url ): ?string {
if ( $return_url === null || $return_url === '' ) {
return null;
}
$validated = \wp_validate_redirect( $return_url, '' );
return ( $validated === '' ) ? null : $validated;
}