Skip to content

ValidatedSanitizedInput.MissingUnslash & ValidatedSanitizedInput.InputNotSanitized #1006

@jcvignoli

Description

@jcvignoli

My code:

if ( 0 === stripos( esc_url_raw( wp_unslash( strval( $_SERVER['REQUEST_URI'] ?? '' ) ) ), site_url( '', 'relative' ) . Get_Options::get_popup_url( 'movie_search' ) ) && $sanitized_film !== null ) {

The error:

WARNING	WordPress.Security.ValidatedSanitizedInput.MissingUnslash	$_SERVER['REQUEST_URI'] not unslashed before sanitization. Use wp_unslash() or similar
WARNING	WordPress.Security.ValidatedSanitizedInput.InputNotSanitized	Detected usage of a non-sanitized input variable: $_SERVER['REQUEST_URI']

$_SERVER['REQUEST_URI'] is escaped by both wp_unslash() and esc_url_raw(). I have dozens of similar errors related to sanitization, I'd like to know how I'm supposed to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions