Skip to content

Conversation

nielsdos
Copy link
Member

The notice was outputted before the creation of the file even took place. Therefore, if the creation of the file fails, the notice is outputted while it shouldn't have been.
This changes one test which indeed suffered from this issue due to the open_basedir restriction.

The notice was outputted before the creation of the file even took
place. Therefore, if the creation of the file fails, the notice is
outputted while it shouldn't have been.
This changes one test which indeed suffered from this issue due to the
open_basedir restriction.
@nielsdos nielsdos requested a review from bukka as a code owner October 16, 2025 19:55
@nielsdos nielsdos linked an issue Oct 16, 2025 that may be closed by this pull request
The function returned false, this should've never been outputted in the
first place.
if (fd == -1) {
/* Use default temporary directory. */
if (!(flags & PHP_TMP_FILE_SILENT)) {
php_error_docref(NULL, E_NOTICE, "file created in the system's temporary directory");
Copy link
Member

@TimWolla TimWolla Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively perhaps just:

file will be created […]

Looking at ext/standard/tests/file/bug52624.phpt folks might otherwise be confused why the final error message mentions /tmp.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean. I'm undecided yet, hence also the TODO I put

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tempnam notice message incorrect

2 participants