本文整理汇总了PHP中wp_kses_bad_protocol_once函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_kses_bad_protocol_once函数的具体用法?PHP wp_kses_bad_protocol_once怎么用?PHP wp_kses_bad_protocol_once使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_kses_bad_protocol_once函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: safe_clean_url
function safe_clean_url($url)
{
// Clean up the string
$url = trim($url, "' \" \r \n");
// Check against whitelist for properties allowed to have URL values
if (!in_array($this->property, $this->props_w_urls)) {
return '';
}
$url = wp_kses_bad_protocol_once($url, $this->allowed_protocols);
if (empty($url)) {
return '';
}
return "url('{$url}')";
}
示例2: wp_kses_bad_protocol_once
function wp_kses_bad_protocol_once($string, $allowed_protocols, $count = 1)
{
$string2 = preg_split('/:|�*58;|�*3a;/i', $string, 2);
if (isset($string2[1]) && !preg_match('%/\\?%', $string2[0])) {
$string = trim($string2[1]);
$protocol = wp_kses_bad_protocol_once2($string2[0], $allowed_protocols);
if ('feed:' == $protocol) {
if ($count > 2) {
return '';
}
$string = wp_kses_bad_protocol_once($string, $allowed_protocols, ++$count);
if (empty($string)) {
return $string;
}
}
$string = $protocol . $string;
}
return $string;
}
示例3: wp_kses_bad_protocol
/**
* Sanitize string from bad protocols.
*
* This function removes all non-allowed protocols from the beginning of
* $string. It ignores whitespace and the case of the letters, and it does
* understand HTML entities. It does its work in a while loop, so it won't be
* fooled by a string like "javascript:javascript:alert(57)".
*
* @since 1.0.0
*
* @param string $string Content to filter bad protocols from
* @param array $allowed_protocols Allowed protocols to keep
* @return string Filtered content
*/
function wp_kses_bad_protocol($string, $allowed_protocols)
{
$string = wp_kses_no_null($string);
$string2 = $string . 'a';
while ($string != $string2) {
$string2 = $string;
$string = wp_kses_bad_protocol_once($string, $allowed_protocols);
}
# while
return $string;
}
示例4: wp_kses_bad_protocol
function wp_kses_bad_protocol($string, $allowed_protocols)
###############################################################################
# This function removes all non-allowed protocols from the beginning of
# $string. It ignores whitespace and the case of the letters, and it does
# understand HTML entities. It does its work in a while loop, so it won't be
# fooled by a string like "javascript:javascript:alert(57)".
###############################################################################
{
$string = wp_kses_no_null($string);
$string = preg_replace('/\xad+/', '', $string); # deals with Opera "feature"
$string2 = $string.'a';
while ($string != $string2) {
$string2 = $string;
$string = wp_kses_bad_protocol_once($string, $allowed_protocols);
} # while
return $string;
} # function wp_kses_bad_protocol
示例5: wp_kses_bad_protocol
/**
* Sanitize string from bad protocols.
*
* This function removes all non-allowed protocols from the beginning of
* $string. It ignores whitespace and the case of the letters, and it does
* understand HTML entities. It does its work in a while loop, so it won't be
* fooled by a string like "javascript:javascript:alert(57)".
*
* @since 1.0.0
*
* @param string $string Content to filter bad protocols from
* @param array $allowed_protocols Allowed protocols to keep
* @return string Filtered content
*/
function wp_kses_bad_protocol($string, $allowed_protocols)
{
$string = wp_kses_no_null($string);
$string = preg_replace('/\\xad+/', '', $string);
# deals with Opera "feature"
$string2 = $string . 'a';
while ($string != $string2) {
$string2 = $string;
$string = wp_kses_bad_protocol_once($string, $allowed_protocols);
}
# while
return $string;
}