• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_kses_bad_protocol_once函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_kses_bad_protocol_once2函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_kses_bad_protocol函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap