當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wp_kses_bad_protocol_once函數代碼示例

本文整理匯總了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}')";
 }
開發者ID:ryanhellyer,項目名稱:pressabl,代碼行數:14,代碼來源:index.php

示例2: wp_kses_bad_protocol_once

function wp_kses_bad_protocol_once($string, $allowed_protocols, $count = 1)
{
    $string2 = preg_split('/:|&#0*58;|&#x0*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;
}
開發者ID:AppItNetwork,項目名稱:yii2-wordpress-themes,代碼行數:19,代碼來源:kses.php

示例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;
}
開發者ID:fka2004,項目名稱:webkit,代碼行數:25,代碼來源:kses.php

示例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
開發者ID:staylor,項目名稱:develop.svn.wordpress.org,代碼行數:19,代碼來源:kses.php

示例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;
}
開發者ID:papayalabs,項目名稱:htdocs,代碼行數:27,代碼來源:kses.php


注:本文中的wp_kses_bad_protocol_once函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。