reference/url/functions/parse-url.xml
195fde0082f2771a210a2818d3d4fa09c7ee785d
...
...
@@ -9,7 +9,7 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>parse_url</methodname>
12
+
<type class="union"><type>int</type><type>string</type><type>array</type><type>null</type><type>false</type></type><methodname>parse_url</methodname>
13
13
<methodparam><type>string</type><parameter>url</parameter></methodparam>
14
14
<methodparam choice="opt"><type>int</type><parameter>component</parameter><initializer>-1</initializer></methodparam>
15
15
</methodsynopsis>
...
...
@@ -20,7 +20,7 @@
20
20
</para>
21
21
<para>
22
22
This function is <emphasis role="strong">not</emphasis> meant to validate
23
-
the given URL, it only breaks it up into the above listed parts. Partial and invalid
23
+
the given URL, it only breaks it up into the parts listed below. Partial and invalid
24
24
URLs are also accepted, <function>parse_url</function> tries its best to
25
25
parse them correctly.
26
26
</para>
...
...
@@ -252,11 +252,15 @@ array(3) {
252
252

253
253
<refsect1 role="notes">
254
254
&reftitle.notes;
255
-
<note>
255
+
<caution>
256
256
<para>
257
-
This function may not give correct results for relative URLs.
257
+
This function may not give correct results for relative or invalid URLs,
258
+
and the results may not even match common behavior of HTTP clients.
259
+
If URLs from untrusted input need to be parsed, extra validation is
260
+
required, e.g. by using <function>filter_var</function> with the
261
+
<constant>FILTER_VALIDATE_URL</constant> filter.
258
262
</para>
259
-
</note>
263
+
</caution>
260
264
<note>
261
265
<para>
262
266
This function is intended specifically for the purpose of parsing URLs
...
...
@@ -281,7 +285,6 @@ array(3) {
281
285
</para>
282
286
</refsect1>
283
287
</refentry>
284
-

285
288
<!-- Keep this comment at the end of the file
286
289
Local variables:
287
290
mode: sgml
288
291