diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-19 10:03:11 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-19 10:03:11 +0100 |
commit | cfa2f0f598196b00dcabd95fe631a5d190ab8457 (patch) | |
tree | f021c34f8760b045626e3107dff76b24e91ffd18 | |
parent | 97bcfe54e7314122673d6d5134c35cb5a3f44969 (diff) | |
parent | d53e9c7392403abc80a38bf371ad27cf10ce7865 (diff) | |
download | php-git-cfa2f0f598196b00dcabd95fe631a5d190ab8457.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
-rw-r--r-- | ext/standard/ftp_fopen_wrapper.c | 2 | ||||
-rw-r--r-- | ext/standard/tests/streams/bug77765.phpt | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 26e55cba01..4fdd91d98f 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -804,7 +804,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, if (result < 200 || result > 299) { ssb->sb.st_mode |= S_IFREG; } else { - ssb->sb.st_mode |= S_IFDIR; + ssb->sb.st_mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH; } php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept SIZE command in ASCII mode */ diff --git a/ext/standard/tests/streams/bug77765.phpt b/ext/standard/tests/streams/bug77765.phpt new file mode 100644 index 0000000000..fa933ffc0d --- /dev/null +++ b/ext/standard/tests/streams/bug77765.phpt @@ -0,0 +1,22 @@ +--TEST-- +stat() on directory should return 40755 for ftp:// +--SKIPIF-- +<?php +if (array_search('ftp',stream_get_wrappers()) === FALSE) die("skip ftp wrapper not available."); +if (!function_exists('pcntl_fork')) die("skip pcntl_fork() not available."); +?> +--FILE-- +<?php + +require __DIR__ . "/../../../ftp/tests/server.inc"; + +$path = "ftp://localhost:" . $port."/www"; + +var_dump(stat($path)['mode']); +?> +==DONE== +--EXPECTF-- +string(11) "SIZE /www +" +int(16877) +==DONE== |