|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-04-20 14:37 UTC] cmb@php.net
Description: ------------ As has been pointed out in bug #55804, tempnam() doesn't explicitly indicate when it is falling back to the system's temp directory. It might be appropriate to raise a notice in this case. Test script: --------------- <?php tempnam('non/existing/directory', 'pre'); Expected result: ---------------- A file is created in the system's temp directory, and additionally a notice is raised: Notice: tempnam(): file created in the system's temporary directory in ... on line ... Actual result: -------------- A file is created in the system's temp directory without any notice. PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 11:00:01 2025 UTC |
okey, a quick patch is: diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index a88c823..439e5e4 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -287,6 +287,7 @@ def_tmp: fd = php_do_open_temporary_file(dir, pfx, opened_path_p); if (fd == -1) { /* Use default temporary directory. */ + php_error_docref(NULL, E_NOTICE, "file created in the system's temporary directory"); goto def_tmp; } return fd; thanks