svn: /phpdoc/en/trunk/reference/filesystem/functions/ realpath.xml
| From: | Philip Olson | Date: | Fri, 04 Sep 2015 17:03:11 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/filesystem/functions/ realpath.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13708@lists.php.net to get a copy of this message | ||
philip Fri, 04 Sep 2015 17:03:11 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=337750
Log:
Implemented user note by Eric Mueller: trailing delimiters are also removed
Changed paths:
U phpdoc/en/trunk/reference/filesystem/functions/realpath.xml
Modified: phpdoc/en/trunk/reference/filesystem/functions/realpath.xml
===================================================================
--- phpdoc/en/trunk/reference/filesystem/functions/realpath.xml 2015-09-04 16:35:56 UTC (rev 337749)
+++ phpdoc/en/trunk/reference/filesystem/functions/realpath.xml 2015-09-04 17:03:11 UTC (rev 337750)
@@ -46,7 +46,8 @@
&reftitle.returnvalues;
<para>
Returns the canonicalized absolute pathname on success. The resulting path
- will have no symbolic link, '/./' or '/../' components.
+ will have no symbolic link, '/./' or '/../' components. Trailing delimiters,
+ such as \ and /, are also removed.
</para>
<para>
<function>realpath</function> returns &false; on failure, e.g. if
@@ -111,7 +112,9 @@
<![CDATA[
<?php
chdir('/var/www/');
-echo realpath('./../../etc/passwd');
+echo realpath('./../../etc/passwd') . PHP_EOL;
+
+echo realpath('/tmp/') . PHP_EOL;
?>
]]>
</programlisting>
@@ -119,6 +122,7 @@
<screen>
<![CDATA[
/etc/passwd
+/tmp
]]>
</screen>
</example>
@@ -132,6 +136,8 @@
<![CDATA[
<?php
echo realpath('/windows/system32');
+
+echo realpath('C:\Program Files\\');
?>
]]>
</programlisting>
@@ -139,6 +145,7 @@
<screen>
<![CDATA[
C:\WINDOWS\System32
+C:\Program Files
]]>
</screen>
</example>