Bug #80993 [NEW]: readlink() works no correctly
| From: | romanmartinuk at gmail dot com | Date: | Tue, 27 Apr 2021 09:14:18 +0000 |
| Subject: | Bug #80993 [NEW]: readlink() works no correctly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-233587@lists.php.net to get a copy of this message | ||
From: romanmartinuk at gmail dot com
Operating system: Windows 10.0.19042
PHP version: 7.3.27
Package: Filesystem function related
Bug Type: Bug
Bug description:readlink() works no correctly
Description:
------------
see table for all version PHP (8.0.3 - 7.1.3)
https://github.com/symfony/symfony/pull/40866#issuecomment-823991452
Test script:
---------------
<?php
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'dir';
mkdir($dir);
$file = $dir . DIRECTORY_SEPARATOR . 'file';
$link1 = $dir . DIRECTORY_SEPARATOR . 'link1';
$link2 = $dir . DIRECTORY_SEPARATOR . 'link2';
touch($file);
symlink($file, $link1);
symlink($link1, $link2);
echo 'PHP=' . PHP_VERSION . ', realpath=' . basename(realpath($link2)) .
', readlink=' . basename(readlink($link2)) ;
unlink($file);
unlink($link1);
unlink($link2);
rmdir($dir);
Expected result:
----------------
PHP=7.3.27, realpath=file, readlink=link1
Actual result:
--------------
PHP=7.3.27, realpath=file, readlink=file
--
Edit bug report at https://bugs.php.net/bug.php?id=80993&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80993&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80993&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80993&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80993&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80993&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80993&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80993&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80993&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80993&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80993&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80993&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80993&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80993&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80993&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80993&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80993&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80993&r=mysqlcfg