is_tainted
(PECL taint >=0.1.0)
is_tainted — 检查一个字符串是否被污染
参数
string
待检查的值。
返回值
如果该值是被污染的字符串,返回 true,否则返回 false。
当 taint.enable 未开启时,
始终返回 false。
示例
示例 #1 is_tainted() 示例
<?php
$name = $_GET['name'] ?? 'world';
var_dump(is_tainted($name));
?>以上示例的输出类似于:
bool(true)
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
