Skip to content

Commit b3affb6

Browse files
committed
luasandbox: fix XML to remove useless wrapping para tags via script
1 parent 70b90be commit b3affb6

21 files changed

Lines changed: 359 additions & 463 deletions

reference/luasandbox/differences.xml

Lines changed: 85 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 990521c9ca64fe7d83016a613b850177d3a90776 Maintainer: leonardolara Status: ready -->
3-
<chapter xml:id="reference.luasandbox.differences" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
2+
<!-- EN-Revision: cc1fd3979ee4c308ca9c086583c4d0e45549d3fe Maintainer: leonardolara Status: ready -->
3+
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="reference.luasandbox.differences">
44
<title>Diferenças do Lua Padrão</title>
55

66
<para>
@@ -9,105 +9,96 @@
99

1010
<simplesect xml:id="reference.luasandbox.differences.unavailable">
1111
<title>Recursos que não estão disponíveis</title>
12-
<para>
13-
<itemizedlist>
14-
<listitem>
15-
<para>
16-
<literal>dofile()</literal>, <literal>loadfile()</literal> e o pacote <literal>io</literal>, pois eles permitem acesso direto ao sistema de arquivos. Se necessário, o acesso ao sistema de arquivos deve ser feito por meio de funções de retorno PHP.
17-
</para>
18-
</listitem>
19-
<listitem>
20-
<para>
21-
O pacote <literal>package</literal>, incluindo <literal>require()</literal> e <literal>module()</literal>, pois depende muito do acesso direto ao sistema de arquivos. Uma reescrita Lua pura, como a usada na extensão MediaWiki Scribunto, pode ser usada em vez disso.
22-
</para>
23-
</listitem>
24-
<listitem>
25-
<para>
26-
<literal>load()</literal> e <literal>loadstring()</literal>, para permitir análise estática do código Lua.
27-
</para>
28-
</listitem>
29-
<listitem>
30-
<para>
31-
<literal>print()</literal>, já que ele envia para a saída padrão. Se necessário, a saída deve ser feita via funções de retorno PHP.
32-
</para>
33-
</listitem>
34-
<listitem>
35-
<para>
36-
A maior parte do pacote <literal>os</literal>, pois permite a manipulação do processo e a execução de outros processos.
37-
</para>
38-
<para>
39-
<itemizedlist>
40-
<listitem>
41-
<para>
42-
<literal>os.clock()</literal>, <literal>os.date()</literal>, <literal>os.difftime()</literal> e <literal>os.time()</literal> permanecem disponíveis.
43-
</para>
44-
</listitem>
45-
</itemizedlist>
46-
</para>
47-
</listitem>
48-
<listitem>
49-
<para>
50-
A maior parte do pacote <literal>debug</literal>, pois permite a manipulação do estado Lua e metadados de maneiras que podem quebrar o isolamento.
51-
</para>
52-
<para>
53-
<itemizedlist>
54-
<listitem>
55-
<para>
56-
<literal>debug.traceback()</literal> permanece disponível.
57-
</para>
58-
</listitem>
59-
</itemizedlist>
60-
</para>
61-
</listitem>
62-
<listitem>
63-
<para>
64-
<literal>string.dump()</literal>, pois pode expor dados internos.
65-
</para>
66-
</listitem>
67-
<listitem>
68-
<para>
69-
<literal>collectgarbage()</literal>, <literal>gcinfo()</literal> e o pacote <literal>coroutine</literal> não foram revisados ​​quanto à segurança.
70-
</para>
71-
</listitem>
72-
</itemizedlist>
73-
</para>
12+
<itemizedlist>
13+
<listitem>
14+
<para>
15+
<literal>dofile()</literal>, <literal>loadfile()</literal> e o pacote <literal>io</literal>, pois eles permitem acesso direto ao sistema de arquivos. Se necessário, o acesso ao sistema de arquivos deve ser feito por meio de funções de retorno PHP.
16+
</para>
17+
</listitem>
18+
<listitem>
19+
<para>
20+
O pacote <literal>package</literal>, incluindo <literal>require()</literal> e <literal>module()</literal>, pois depende muito do acesso direto ao sistema de arquivos. Uma reescrita Lua pura, como a usada na extensão MediaWiki Scribunto, pode ser usada em vez disso.
21+
</para>
22+
</listitem>
23+
<listitem>
24+
<para>
25+
<literal>load()</literal> e <literal>loadstring()</literal>, para permitir análise estática do código Lua.
26+
</para>
27+
</listitem>
28+
<listitem>
29+
<para>
30+
<literal>print()</literal>, já que ele envia para a saída padrão. Se necessário, a saída deve ser feita via funções de retorno PHP.
31+
</para>
32+
</listitem>
33+
<listitem>
34+
<para>
35+
A maior parte do pacote <literal>os</literal>, pois permite a manipulação do processo e a execução de outros processos.
36+
</para>
37+
<itemizedlist>
38+
<listitem>
39+
<para>
40+
<literal>os.clock()</literal>, <literal>os.date()</literal>, <literal>os.difftime()</literal> e <literal>os.time()</literal> permanecem disponíveis.
41+
</para>
42+
</listitem>
43+
</itemizedlist>
44+
</listitem>
45+
<listitem>
46+
<para>
47+
A maior parte do pacote <literal>debug</literal>, pois permite a manipulação do estado Lua e metadados de maneiras que podem quebrar o isolamento.
48+
</para>
49+
<itemizedlist>
50+
<listitem>
51+
<para>
52+
<literal>debug.traceback()</literal> permanece disponível.
53+
</para>
54+
</listitem>
55+
</itemizedlist>
56+
</listitem>
57+
<listitem>
58+
<para>
59+
<literal>string.dump()</literal>, pois pode expor dados internos.
60+
</para>
61+
</listitem>
62+
<listitem>
63+
<para>
64+
<literal>collectgarbage()</literal>, <literal>gcinfo()</literal> e o pacote <literal>coroutine</literal> não foram revisados ​​quanto à segurança.
65+
</para>
66+
</listitem>
67+
</itemizedlist>
7468
</simplesect>
7569

7670
<simplesect xml:id="reference.luasandbox.differences.modified">
7771
<title>Recursos que foram modificados</title>
78-
<para>
79-
<itemizedlist>
80-
<listitem>
81-
<para>
82-
<literal>pcall()</literal> e <literal>xpcall()</literal> não conseguem capturar certos erros, particularmente erros de tempo limite.
83-
</para>
84-
</listitem>
85-
<listitem>
86-
<para>
87-
<literal>tostring()</literal> não inclui endereços de ponteiros.
88-
</para>
89-
</listitem>
90-
<listitem>
91-
<para>
92-
<literal>string.match()</literal> foi corrigido para limitar a profundidade da recursão e verificar periodicamente se há um tempo limite.
93-
</para>
94-
</listitem>
95-
<listitem>
96-
<para>
97-
<literal>math.random()</literal> e <literal>math.randomseed()</literal> foram substituídos por versões que não compartilham estado com <literal>rand()</literal> do PHP.
98-
</para>
99-
</listitem>
100-
<listitem>
101-
<para>
102-
Os metamétodos <literal>__pairs</literal> e <literal>__ipairs</literal> do Lua 5.2 são suportados por <literal>pairs()</literal> e <literal>ipairs()</literal>.
103-
</para>
104-
</listitem>
105-
</itemizedlist>
106-
</para>
72+
<itemizedlist>
73+
<listitem>
74+
<para>
75+
<literal>pcall()</literal> e <literal>xpcall()</literal> não conseguem capturar certos erros, particularmente erros de tempo limite.
76+
</para>
77+
</listitem>
78+
<listitem>
79+
<para>
80+
<literal>tostring()</literal> não inclui endereços de ponteiros.
81+
</para>
82+
</listitem>
83+
<listitem>
84+
<para>
85+
<literal>string.match()</literal> foi corrigido para limitar a profundidade da recursão e verificar periodicamente se há um tempo limite.
86+
</para>
87+
</listitem>
88+
<listitem>
89+
<para>
90+
<literal>math.random()</literal> e <literal>math.randomseed()</literal> foram substituídos por versões que não compartilham estado com <literal>rand()</literal> do PHP.
91+
</para>
92+
</listitem>
93+
<listitem>
94+
<para>
95+
Os metamétodos <literal>__pairs</literal> e <literal>__ipairs</literal> do Lua 5.2 são suportados por <literal>pairs()</literal> e <literal>ipairs()</literal>.
96+
</para>
97+
</listitem>
98+
</itemizedlist>
10799
</simplesect>
108100

109101
</chapter>
110-
111102
<!-- Keep this comment at the end of the file
112103
Local variables:
113104
mode: sgml

reference/luasandbox/examples.xml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 990521c9ca64fe7d83016a613b850177d3a90776 Maintainer: leonardolara Status: ready -->
3-
4-
<chapter xml:id="luasandbox.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
2+
<!-- EN-Revision: cc1fd3979ee4c308ca9c086583c4d0e45549d3fe Maintainer: leonardolara Status: ready -->
3+
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="luasandbox.examples">
54
&reftitle.examples;
65

76
<!-- Add one or more of these <section>'s, with one ore more <example>'s -->
@@ -11,10 +10,9 @@
1110
<para>
1211
Depois de compilado o PHP com suporte ao LuaSandbox, pode-se começar a usar o LuaSandbox para executar com segurança o código Lua fornecido pelo usuário.
1312
</para>
14-
<para>
15-
<example>
16-
<title>Executando um código Lua</title>
17-
<programlisting role="php" xml:id="luasandbox.examples.uniqueidhere">
13+
<example>
14+
<title>Executando um código Lua</title>
15+
<programlisting role="php" xml:id="luasandbox.examples.uniqueidhere">
1816
<![CDATA[
1917
<?php
2018
@@ -59,13 +57,11 @@ assert( $message === 'Algo está errado' );
5957
6058
?>
6159
]]>
62-
</programlisting>
63-
</example>
64-
</para>
60+
</programlisting>
61+
</example>
6562
</section>
6663

6764
</chapter>
68-
6965
<!-- Keep this comment at the end of the file
7066
Local variables:
7167
mode: sgml
@@ -86,4 +82,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
8682
vim: et tw=78 syn=sgml
8783
vi: ts=1 sw=1
8884
-->
89-

reference/luasandbox/luasandbox/callfunction.xml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: cdc9d28d334bbc08386fecf8aade66080004a9dd Maintainer: leonardolara Status: ready -->
3-
4-
<refentry xml:id="luasandbox.callfunction" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
2+
<!-- EN-Revision: cc1fd3979ee4c308ca9c086583c4d0e45549d3fe Maintainer: leonardolara Status: ready -->
3+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="luasandbox.callfunction">
54
<refnamediv>
65
<refname>LuaSandbox::callFunction</refname>
76
<refpurpose>Chama uma função em uma variável global Lua</refpurpose>
@@ -62,10 +61,9 @@
6261

6362
<refsect1 role="examples">
6463
&reftitle.examples;
65-
<para>
66-
<example>
67-
<title>Chamando uma função Lua</title>
68-
<programlisting role="php">
64+
<example>
65+
<title>Chamando uma função Lua</title>
66+
<programlisting role="php">
6967
<![CDATA[
7068
<?php
7169
@@ -77,13 +75,11 @@ $captures = $sandbox->callFunction( 'string.match', $string, $pattern );
7775
7876
?>
7977
]]>
80-
</programlisting>
81-
</example>
82-
</para>
78+
</programlisting>
79+
</example>
8380
</refsect1>
8481

8582
</refentry>
86-
8783
<!-- Keep this comment at the end of the file
8884
Local variables:
8985
mode: sgml

reference/luasandbox/luasandbox/disableprofiler.xml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 990521c9ca64fe7d83016a613b850177d3a90776 Maintainer: leonardolara Status: ready -->
3-
4-
<refentry xml:id="luasandbox.disableprofiler" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
2+
<!-- EN-Revision: cc1fd3979ee4c308ca9c086583c4d0e45549d3fe Maintainer: leonardolara Status: ready -->
3+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="luasandbox.disableprofiler">
54
<refnamediv>
65
<refname>LuaSandbox::disableProfiler</refname>
76
<refpurpose>Desabilita o profiler</refpurpose>
@@ -11,7 +10,7 @@
1110
&reftitle.description;
1211
<methodsynopsis>
1312
<modifier>public</modifier> <type>void</type><methodname>LuaSandbox::disableProfiler</methodname>
14-
<void />
13+
<void/>
1514
</methodsynopsis>
1615
<para>
1716
Desabilita o profiler.
@@ -33,16 +32,13 @@
3332

3433
<refsect1 role="seealso">
3534
&reftitle.seealso;
36-
<para>
37-
<simplelist>
38-
<member><methodname>LuaSandbox::enableProfiler</methodname></member>
39-
<member><methodname>LuaSandbox::getProfilerFunctionReport</methodname></member>
40-
</simplelist>
41-
</para>
35+
<simplelist>
36+
<member><methodname>LuaSandbox::enableProfiler</methodname></member>
37+
<member><methodname>LuaSandbox::getProfilerFunctionReport</methodname></member>
38+
</simplelist>
4239
</refsect1>
4340

4441
</refentry>
45-
4642
<!-- Keep this comment at the end of the file
4743
Local variables:
4844
mode: sgml

reference/luasandbox/luasandbox/enableprofiler.xml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 990521c9ca64fe7d83016a613b850177d3a90776 Maintainer: leonardolara Status: ready -->
3-
4-
<refentry xml:id="luasandbox.enableprofiler" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
2+
<!-- EN-Revision: cc1fd3979ee4c308ca9c086583c4d0e45549d3fe Maintainer: leonardolara Status: ready -->
3+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="luasandbox.enableprofiler">
54
<refnamediv>
65
<refname>LuaSandbox::enableProfiler</refname>
76
<refpurpose>Habilita o profiler</refpurpose>
@@ -48,16 +47,13 @@
4847

4948
<refsect1 role="seealso">
5049
&reftitle.seealso;
51-
<para>
52-
<simplelist>
53-
<member><methodname>LuaSandbox::disableProfiler</methodname></member>
54-
<member><methodname>LuaSandbox::getProfilerFunctionReport</methodname></member>
55-
</simplelist>
56-
</para>
50+
<simplelist>
51+
<member><methodname>LuaSandbox::disableProfiler</methodname></member>
52+
<member><methodname>LuaSandbox::getProfilerFunctionReport</methodname></member>
53+
</simplelist>
5754
</refsect1>
5855

5956
</refentry>
60-
6157
<!-- Keep this comment at the end of the file
6258
Local variables:
6359
mode: sgml

reference/luasandbox/luasandbox/getcpuusage.xml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 990521c9ca64fe7d83016a613b850177d3a90776 Maintainer: leonardolara Status: ready -->
3-
4-
<refentry xml:id="luasandbox.getcpuusage" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
2+
<!-- EN-Revision: cc1fd3979ee4c308ca9c086583c4d0e45549d3fe Maintainer: leonardolara Status: ready -->
3+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="luasandbox.getcpuusage">
54
<refnamediv>
65
<refname>LuaSandbox::getCPUUsage</refname>
76
<refpurpose>Obtém o uso atual do tempo de CPU do ambiente Lua</refpurpose>
@@ -11,7 +10,7 @@
1110
&reftitle.description;
1211
<methodsynopsis>
1312
<modifier>public</modifier> <type>float</type><methodname>LuaSandbox::getCPUUsage</methodname>
14-
<void />
13+
<void/>
1514
</methodsynopsis>
1615
<para>
1716
Obtém o uso atual do tempo de CPU do ambiente Lua.
@@ -44,17 +43,14 @@
4443

4544
<refsect1 role="seealso">
4645
&reftitle.seealso;
47-
<para>
48-
<simplelist>
49-
<member><methodname>LuaSandbox::getMemoryUsage</methodname></member>
50-
<member><methodname>LuaSandbox::getPeakMemoryUsage</methodname></member>
51-
<member><methodname>LuaSandbox::setCPULimit</methodname></member>
52-
</simplelist>
53-
</para>
46+
<simplelist>
47+
<member><methodname>LuaSandbox::getMemoryUsage</methodname></member>
48+
<member><methodname>LuaSandbox::getPeakMemoryUsage</methodname></member>
49+
<member><methodname>LuaSandbox::setCPULimit</methodname></member>
50+
</simplelist>
5451
</refsect1>
5552

5653
</refentry>
57-
5854
<!-- Keep this comment at the end of the file
5955
Local variables:
6056
mode: sgml

0 commit comments

Comments
 (0)