mirror of
https://github.com/php/doc-ja.git
synced 2026-03-24 15:12:22 +01:00
110 lines
3.5 KiB
XML
110 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 60c391265d2a51003e1ed0952e5a2413f81c7fc2 Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: shimooka,mumumu -->
|
|
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.8 -->
|
|
<refentry xml:id="function.escapeshellarg" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>escapeshellarg</refname>
|
|
<refpurpose>シェル引数として使用される文字列をエスケープする</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>escapeshellarg</methodname>
|
|
<methodparam><type>string</type><parameter>arg</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>escapeshellarg</function> は、文字列をシングルクオート
|
|
で括り、既存のシングルクオートを全てクオート/エスケープします。こ
|
|
れにより、文字列を直接シェル関数に渡し、単一の安全な引数として処
|
|
理することを可能にします。この関数は、ユーザー入力からの入力を
|
|
シェル関数への引数として渡す際にエスケープするために使用する必要
|
|
があります。シェル関数には、<function>exec</function>,
|
|
<function>system</function>そして
|
|
<link linkend="language.operators.execution">バッククォート演算子</link>
|
|
を含むシェル関数が含まれます。
|
|
</para>
|
|
<para>
|
|
Windows では、<function>escapeshellarg</function>
|
|
は、パーセント記号と感嘆符 (遅延環境変数の展開) とダブルクォートをスペースに置き換えます。
|
|
そして、文字列をダブルクォートで囲みます。
|
|
さらに、連続するバックスラッシュ(<literal>\</literal>) は、もうひとつバックスラッシュを追加すればエスケープできます。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>arg</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
エスケープされる引数
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
エスケープされた文字列
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>escapeshellarg</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
system('ls '.escapeshellarg($dir));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>escapeshellcmd</function></member>
|
|
<member><function>exec</function></member>
|
|
<member><function>popen</function></member>
|
|
<member><function>system</function></member>
|
|
<member><link linkend="language.operators.execution">バッククォート演算子</link></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|