_wp_sanitize_utf8_in_redirect

URL encode UTF-8 characters in a URL.

Description

(string) _wp_sanitize_utf8_in_redirect( (array) $matches ); 

Returns (string)

URL-encoded version of the first RegEx match.

Parameters (1)

0. $matches (array)
RegEx matches against the redirect location.

Usage

  1. if ( !function_exists( '_wp_sanitize_utf8_in_redirect' ) ) { 
  2. require_once ABSPATH . WPINC . '/pluggable.php'; 
  3.  
  4. // RegEx matches against the redirect location. 
  5. $matches = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _wp_sanitize_utf8_in_redirect($matches); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/pluggable.php  
  1. function _wp_sanitize_utf8_in_redirect( $matches ) { 
  2. return urlencode( $matches[0] );