diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-19 10:02:50 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-19 10:03:05 +0100 |
commit | d53e9c7392403abc80a38bf371ad27cf10ce7865 (patch) | |
tree | f83f8cfc038679a37997a7125db50fd8aebafb96 | |
parent | 20c261b2fecd6b29e002de89d9171268bf6930e5 (diff) | |
parent | fe2885d80a76db84fd3a8e1556aff2221be195e1 (diff) | |
download | php-git-d53e9c7392403abc80a38bf371ad27cf10ce7865.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/standard/ftp_fopen_wrapper.c | 2 | ||||
-rw-r--r-- | ext/standard/tests/streams/bug77765.phpt | 22 |
3 files changed, 25 insertions, 1 deletions
@@ -61,6 +61,8 @@ PHP NEWS (Nikita) . Fixed bug #76717 (var_export() does not create a parsable value for PHP_INT_MIN). (Nikita) + . Fixed bug #77765 (FTP stream wrapper should set the directory as + executable). (Vlad Temian) 07 Mar 2019, PHP 7.3.3 diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index a0416ba0f1..dbcf4233d8 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== |