htmlspecialchars_htmlspecialchars绕过_php switch case语句

电脑杂谈  发布时间:2017-03-03 22:59:33  来源:网络整理
htmlspecialcharshtmlspecialchars

How can we quickly fix this problem, since the proper solution would have performance overhead which we can't consider for this use case.

The goal is to see a quick fix, for example, wouldif(function_exists('iconv')) $value = @iconv('UTF-8', 'UTF-8//IGNORE', $value); work to force convert to Utf8 the url when the htmlspecialchars return empty?

From what I remember of my test, this would strip the non-UTF8 encoded characters from the string, so I guess ".site.com?q=%EC%ED..." would turn into ".site.com?q=". Since this only affects the query string, we might be able to do this to each individual query param and for stuff that doesn't have UTF8 encoding, we just display the encoded data (ie, %EC%ED)? Not sure if it'll work, though, but when I get a chance I'll check it out.


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-35626-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      • 黑槛媞娜
        黑槛媞娜

        只是美国这种做法有点可恶

      热点图片
      拼命载入中...