Req #69489 [Ana->Csd]: tempnam() should raise notice if falling back to temp dir
Edit report at https://bugs.php.net/bug.php?id=69489&edit=1
ID: 69489
Updated by: ab@php.net
Reported by: cmb@php.net
Summary: tempnam() should raise notice if falling back to
temp dir
-Status: Analyzed
+Status: Closed
Type: Feature/Change Request
Package: Filesystem function related
Operating System: *
PHP Version: 5.6.8
-Assigned To:
+Assigned To: ab
Block user comment: N
Private report: N
New Comment:
The PR is merged in 7.1.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2015-05-12 12:02:38] jpauli@php.net
Cant we disable this Notice in extension code (if needed) ?
------------------------------------------------------------------------
[2015-04-21 16:11:46] cmb@php.net
@laruence: that's also what I came up with in the meantime. :)
However, I don't know what other functionality expect tempnam might
also be affected by this change, because php_open_temporary_fd(_ex)
seems to be part of the public API, and might be used by
extensions. If that is so, the notice might not be desired
everywhere.
Anyhow, the biggest issue with submitting a PR is that the PHP test
suite is not running stable on (my) Windows.
------------------------------------------------------------------------
[2015-04-21 14:12:56] laruence@php.net
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
------------------------------------------------------------------------
[2015-04-20 15:30:06] cmb@php.net
Related To: Bug #55804
------------------------------------------------------------------------
[2015-04-20 14:45:13] cmb@php.net
Related To: Bug #55804
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=69489
--
Edit this bug report at https://bugs.php.net/bug.php?id=69489&edit=1
Thread (7 messages)