|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-08-27 14:23 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: cmb
[2015-08-27 14:23 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 17:00:01 2025 UTC |
Description: ------------ Stream wrappers which ultimately result in file operations which should be permitted by safe mode do not work in some circumstances. For example, a stream wrapper which simply stores files in sys_get_temp_dir() works fine without safe mode, but fails when that is enabled: // copy 1: file to stream wrapper $ok = copy('/tmp/source.txt', 'temp://destination.txt'); // copy 2: stream wrapper to file $ok = copy('temp://destination.txt', '/tmp/source.txt'); // copy 3: SAME file as stream wrapper to file $ok = copy(sys_get_temp_dir() . '/destination.txt', '/tmp/source.txt'); Under safe mode, the second copy fails with error message Warning: copy() [function.copy]: Unable to access temp://destination.txt in .../test-copy.php on line ... This may be related to https://bugs.php.net/bug.php?id=46888 Test script: --------------- http://drupal.org/files/test-copy.txt Expected result: ---------------- All three file copies should succeed, since sys_get_temp_dir() returns a directory accessible to safe-mode. Actual result: -------------- Second copy fails. Third copy, which refers to the same files, succeeds.