<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.taint.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.is-tainted.php',
    1 => 'is_tainted',
    2 => '检查一个字符串是否被污染',
  ),
  'up' => 
  array (
    0 => 'ref.taint.php',
    1 => 'Taint 函数',
  ),
  'prev' => 
  array (
    0 => 'ref.taint.php',
    1 => 'Taint 函数',
  ),
  'next' => 
  array (
    0 => 'function.taint.php',
    1 => 'taint',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/taint/functions/is-tainted.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.is-tainted" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">is_tainted</h1>
  <p class="verinfo">(PECL taint &gt;=0.1.0)</p><p class="refpurpose"><span class="refname">is_tainted</span> &mdash; <span class="dc-title">检查一个字符串是否被污染</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.is-tainted-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">function</span> <span class="methodname"><strong>is_tainted</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   检查给定的值是否携带污点标记。只有字符串可能被污染，
   其他任何类型都返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.is-tainted-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">string</code></dt>
    <dd>
     <p class="simpara">
      待检查的值。
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.is-tainted-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   如果该值是被污染的字符串，返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>，否则返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
   当 <a href="taint.configuration.php#ini.taint.enable" class="link">taint.enable</a> 未开启时，
   始终返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.is-tainted-examples">
  <h3 class="title">示例</h3>
  <div class="example" id="example-1">
   <p><strong>示例 #1 <span class="function"><strong>is_tainted()</strong></span> 示例</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$name </span><span style="color: #007700">= </span><span style="color: #0000BB">$_GET</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">] ?? </span><span style="color: #DD0000">'world'</span><span style="color: #007700">;
</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">is_tainted</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">));
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>以上示例的输出类似于：</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">bool(true)</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.is-tainted-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.taint.php" class="function" rel="rdfs-seeAlso">taint()</a> - 将字符串标记为已污染</span></li>
    <li><span class="function"><a href="function.untaint.php" class="function" rel="rdfs-seeAlso">untaint()</a> - 清除字符串上的污点标记</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>