Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_sanitize_redirect [ WordPress Function ]

wp_sanitize_redirect ( $location )
Returns:
  • (string) redirect-sanitized URL
Defined at:



Sanitizes a URL for use in a redirect.

Source


<?php
function wp_sanitize_redirect($location) {
    
$location preg_replace('|[^a-z0-9-~+_.?#=&;,/:%!]|i'''$location);
    
$location wp_kses_no_null($location);

    
// remove %0d and %0a from location
    
$strip = array('%0d''%0a''%0D''%0A');
    
$location _deep_replace($strip$location);
    return 
$location;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics