Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-14930: Revert "Reserve less file space if possible in a directory entry" #14933

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ext/standard/tests/streams/gh14930.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--TEST--
GH-14930: Custom stream wrapper dir_readdir output truncated to 255 characters in PHP 8.3
--FILE--
<?php

class DummyWrapper
{
public $context;

public function dir_opendir($url, $options)
{
return true;
}

public function dir_readdir()
{
return 'very-long-filename-ieNoquiaC6ijeiy9beejaiphoriejo2cheehooGou8uhoh7eh0gefahyuQuohd7eec9auso9eeFah2Maedohsemi1eetoo5fo5biePh5eephai7SiuguipouLeemequ2oope9aigoQu5efak2aLeri9ithaiJ9eew3dianaiHoo1aexaighiitee6geghiequ5nohhiikahwee8ohk2Soip2Aikeithohdeitiedeiku7DiTh2eep3deitiedeiku7DiTh2ee.txt';
}
}

stream_wrapper_register('dummy', DummyWrapper::class);

$dh = opendir('dummy://', stream_context_create());
var_dump(readdir($dh));
?>
--EXPECT--
string(288) "very-long-filename-ieNoquiaC6ijeiy9beejaiphoriejo2cheehooGou8uhoh7eh0gefahyuQuohd7eec9auso9eeFah2Maedohsemi1eetoo5fo5biePh5eephai7SiuguipouLeemequ2oope9aigoQu5efak2aLeri9ithaiJ9eew3dianaiHoo1aexaighiitee6geghiequ5nohhiikahwee8ohk2Soip2Aikeithohdeitiedeiku7DiTh2eep3deitiedeiku7DiTh2ee.txt"
4 changes: 0 additions & 4 deletions main/php_streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ typedef struct _php_stream_statbuf {
} php_stream_statbuf;

typedef struct _php_stream_dirent {
#ifdef NAME_MAX
char d_name[NAME_MAX + 1];
#else
char d_name[MAXPATHLEN];
#endif
unsigned char d_type;
} php_stream_dirent;

Expand Down
Loading