Bug #77523 [NEW]: glob pattern is limited to 260 characters
| From: | nospam at unclassified dot de | Date: | Fri, 25 Jan 2019 23:24:18 +0000 |
| Subject: | Bug #77523 [NEW]: glob pattern is limited to 260 characters | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-219218@lists.php.net to get a copy of this message | ||
From: nospam at unclassified dot de
Operating system: Windows 10.1709
PHP version: 7.1.26
Package: *Directory/Filesystem functions
Bug Type: Bug
Bug description:glob pattern is limited to 260 characters
Description:
------------
This is what I do:
glob("pages/[Cc][Oo][Nn][Tt][Aa][Cc][Tt]/[Oo][Dd][Ll][Rr]0[Vv][Ss]8[Cc][Gg][Rr][Jj][Bb][Ii][Ll][Aa][Ww][Gg][Pp][Nn][Bb][Tt][Rr]4[Uu][Dd]3[Bb][Nn][Kk][Aa][Ee]/[Dd][Ee][Mm][Oo]/[Ii][Mm][Gg]/[Vv][Ss]2018[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt][Ww][Aa][Rr][Nn][Ii][Nn][Gg][Ss].[Pp][Nn][Gg]")
This is what I get:
Warning: glob(): Pattern exceeds the maximum allowed length of 260
characters
The string passed to glob() is 279 characters long. And it may even be
longer. I has to be this complicated to determine the correct casing of
a file name on disk.
This restriction is neither documented nor understandable. The pattern
length should not matter at all. And even if you think that file paths
of actual files in the filesystem are limited to 260 characters on
Windows, you may need to update your knowledge from at least 20 years
ago. This restriction only exists for deprecated legacy software, which
I hope PHP is not.
Test script:
---------------
See above.
--
Edit bug report at https://bugs.php.net/bug.php?id=77523&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77523&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77523&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77523&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77523&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77523&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77523&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77523&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77523&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77523&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77523&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77523&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77523&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77523&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77523&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77523&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77523&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77523&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77523&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77523&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77523&r=mysqlcfg