mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 08:22:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@325732 c90b9560-bf6c-de11-be94-00142212c4b1
125 lines
3.8 KiB
XML
125 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 4d81bf20250c93fdfb7b114c5d8abe13f311fba4 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.2 -->
|
|
<refentry xml:id="function.escapeshellcmd" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>escapeshellcmd</refname>
|
|
<refpurpose>Escapar meta-caracteres del intérprete de comandos</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>escapeshellcmd</methodname>
|
|
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>escapeshellcmd</function> escapa cualquier caracter en una
|
|
cadena que pudiera ser usada para engañar a un comando shell para que ejecute
|
|
comandos arbitrarios. Esta función debería usarse para asegurarse de
|
|
que cualquier información procedente de la entrada del usuario sea escapada antes de que dicha información
|
|
sea pasada a las funciones <function>exec</function> o
|
|
<function>system</function>, o al <link
|
|
linkend="language.operators.execution">operador de comilla
|
|
invertida</link>.
|
|
</para>
|
|
<para>
|
|
Los siguientes caracteres son precedidos por una barra invertida:
|
|
<literal>#&;`|*?~<>^()[]{}$\</literal>, <literal>\x0A</literal>
|
|
y <literal>\xFF</literal>. <literal>'</literal> y <literal>"</literal>
|
|
son escapados únicamente si no están emparejados. En Windows, todos estos caracteres
|
|
más <literal>%</literal> son reemplazados en su lugar por un espacio.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>command</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El comando a ser escapado.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
La cadena escapada.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>escapeshellcmd</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Permitimos intencionadamente un número arbitrario de argumentos aquí.
|
|
$comando = './configure '.$_POST['configure_options'];
|
|
|
|
$comando_escapado = escapeshellcmd($comando);
|
|
|
|
system($comando_escapado);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
<warning xmlns="http://docbook.org/ns/docbook">
|
|
<para>
|
|
<function>escapeshellcmd</function> debería usarse en la cadena de comandos
|
|
completa, y aún permitir al atacante pasar
|
|
un número de argumentos arbitrario. Para escapar un único argumento
|
|
se debería usar en su lugar la función <function>escapeshellarg</function>.
|
|
</para>
|
|
</warning>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>escapeshellarg</function></member>
|
|
<member><function>exec</function></member>
|
|
<member><function>popen</function></member>
|
|
<member><function>system</function></member>
|
|
<member><link linkend="language.operators.execution">operador de comilla invertida</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
|
|
--> |