From: Stanislav Malyshev Date: Sun, 20 Apr 2014 22:26:51 +0000 (-0700) Subject: Merge branch 'PHP-5.5' into PHP-5.6 X-Git-Tag: PRE_PHPNG_MERGE~359^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=774f16318b3739e751d5a041f3601a3cf3000614;p=php Merge branch 'PHP-5.5' into PHP-5.6 * PHP-5.5: Fix bug #65701: Do not use cache for file file copy --- 774f16318b3739e751d5a041f3601a3cf3000614 diff --cc NEWS index f0316ee6e7,85ebf26dda..e0503fb3ef --- a/NEWS +++ b/NEWS @@@ -6,18 -6,26 +6,21 @@@ PH . Fixed bug #67079 (Missing MIME types for XML/XSL files). (Anatol) - Core: - . Fixed bug #65701 (copy() doesn't work when destination filename is created - by tempnam()). (Boro Sitnikovski) - . Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol) - -- DOM: - . Fixed bug #67081 (DOMDocumentType->internalSubset returns entire DOCTYPE tag, - not only the subset). (Anatol) - -?? ??? 2014, PHP 5.5.12 -- Core: - . Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike) - . Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace - UNIX sockets). (Mike) . Fixed bug #64604 (parse_url is inconsistent with specified port). (Ingo Walz) - . Fixed bug #66182 (exit in stream filter produces segfault). (Mike) - . Fixed bug #66736 (fpassthru broken). (Mike) ++ . Fixed bug #65701 (copy() doesn't work when destination filename is created ++ by tempnam()). (Boro Sitnikovski) + . Fixed bug #66015 (Unexpected array indexing in class's static property). (Bob) + . Added (constant) string/array dereferencing to static scalar expressions + to complete the set; now possible thanks to bug #66015 being fixed. (Bob) + . Fixed bug #66568 (Update reflection information for unserialize() function). + (Ferenc) + . Fixed bug #66660 (Composer.phar install/update fails). (Ferenc) . Fixed bug #67024 (getimagesize should recognize BMP files with negative height). (Gabor Buella) - . Fixed bug #67043 (substr_compare broke by previous change) (Tjerk) + . Fixed bug #67064 (Countable interface prevents using 2nd parameter + ($mode) of count() function). (Bob) ++ . Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol) - cURL: . Fixed bug #66562 (curl_exec returns differently than curl_multi_getcontent). @@@ -59,9 -67,10 +62,6 @@@ - SQLite: . Fixed bug #66967 (Updated bundled libsqlite to 3.8.4.3). (Anatol) - - Standard: - . Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol) -- XSL: - . Fixed bug #53965 ( cannot find files with relative paths - when loaded with "file://"). (Anatol) -- - Apache2 Handler SAPI: . Fixed Apache log issue caused by APR's lack of support for %zu (APR issue https://issues.apache.org/bugzilla/show_bug.cgi?id=56120). diff --cc main/streams/streams.c index 9f9661dbfd,53e37ebe3b..67a151014d --- a/main/streams/streams.c +++ b/main/streams/streams.c @@@ -1918,22 -1918,24 +1918,24 @@@ PHPAPI int _php_stream_rmdir(const cha /* }}} */ /* {{{ _php_stream_stat_path */ -PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) +PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) { php_stream_wrapper *wrapper = NULL; - char *path_to_open = path; + const char *path_to_open = path; int ret; - /* Try to hit the cache first */ - if (flags & PHP_STREAM_URL_STAT_LINK) { - if (BG(CurrentLStatFile) && strcmp(path, BG(CurrentLStatFile)) == 0) { - memcpy(ssb, &BG(lssb), sizeof(php_stream_statbuf)); - return 0; - } - } else { - if (BG(CurrentStatFile) && strcmp(path, BG(CurrentStatFile)) == 0) { - memcpy(ssb, &BG(ssb), sizeof(php_stream_statbuf)); - return 0; + if (!(flags & PHP_STREAM_URL_STAT_NOCACHE)) { + /* Try to hit the cache first */ + if (flags & PHP_STREAM_URL_STAT_LINK) { + if (BG(CurrentLStatFile) && strcmp(path, BG(CurrentLStatFile)) == 0) { + memcpy(ssb, &BG(lssb), sizeof(php_stream_statbuf)); + return 0; + } + } else { + if (BG(CurrentStatFile) && strcmp(path, BG(CurrentStatFile)) == 0) { + memcpy(ssb, &BG(ssb), sizeof(php_stream_statbuf)); + return 0; + } } }