php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76735 Incorrect message in fopen on invalid mode
Submitted: 2018-08-13 07:19 UTC Modified: 2020-09-22 12:51 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:0 of 0 (0.0%)
From: robert dot jelen at email dot cz Assigned: cmb (profile)
Status: Closed Package: Streams related
PHP Version: 7.1.20 OS: Debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: robert dot jelen at email dot cz
New email:
PHP Version: OS:

 

 [2018-08-13 07:19 UTC] robert dot jelen at email dot cz
Description:
------------
The message claims success, although it is a warning and the file fails to open. 

Test script:
---------------
<?php

$f = fopen('existing.file', 'Q');


Expected result:
----------------
PHP Warning:  fopen(existing.file): failed to open stream: Mode "Q" is not valid in /home/robert/test.php on line 3

Actual result:
--------------
PHP Warning:  fopen(existing.file): failed to open stream: Success in /home/robert/test.php on line 3

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-22 12:51 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-09-22 12:51 UTC] cmb@php.net
I can confirm the erroneous error message, although it is not
necessarily "Success", but rather what corresponds to the current
`errno`.
 [2020-09-22 12:59 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #76735: Incorrect message in fopen on invalid mode
On GitHub:  https://github.com/php/php-src/pull/6187
Patch:      https://github.com/php/php-src/pull/6187.patch
 [2020-09-23 09:15 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2576c57a5133df757c51f341e794bf53add7663f
Log: Fix #76735: Incorrect message in fopen on invalid mode
 [2020-09-23 09:15 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 02 20:01:28 2024 UTC