Switch language

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




wp_kses_bad_protocol_once2 [ WordPress Function ]

wp_kses_bad_protocol_once2 ( $string, $allowed_protocols )
Access:
  • private
Parameters:
  • (string) $string URI scheme to check against the whitelist
  • (string) $allowed_protocols Allowed protocols
Returns:
  • (string) Sanitized content
Defined at:



Callback for wp_kses_bad_protocol_once() regular expression.

This function processes URL protocols, checks to see if they're in the whitelist or not, and returns different data depending on the answer.

Source


<?php
function wp_kses_bad_protocol_once2$string$allowed_protocols ) {
    
$string2 wp_kses_decode_entities($string);
    
$string2 preg_replace('/\s/'''$string2);
    
$string2 wp_kses_no_null($string2);
    
$string2 strtolower($string2);

    
$allowed false;
    foreach ( (array) 
$allowed_protocols as $one_protocol )
        if ( 
strtolower($one_protocol) == $string2 ) {
            
$allowed true;
            break;
        }

    if (
$allowed)
        return 
"$string2:";
    else
        return 
'';
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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