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
只是美国这种做法有点可恶