php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64860 Missing documentation for new return value in function is_file
Submitted: 2013-05-16 13:02 UTC Modified: 2016-09-09 16:47 UTC
From: spasic dot dejan at yahoo dot de Assigned: cmb (profile)
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
38 - 26 = ?
Subscribe to this entry?

 
 [2013-05-16 13:02 UTC] spasic dot dejan at yahoo dot de
Description:
------------
PHP 5.4.x

It was added a new return value for the function is_file. When given parameter 
which is given includes a trailing null byte, it returns NULL instead of FALSE. 
This information is missing!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-25 00:19 UTC] philip@php.net
What's the change? Does it affect other file functions? The PHP changelog does not 
mention this (or so it seems) but if there is something to document here then the 
following should also be updated:

http://us2.php.net/manual/en/security.filesystem.nullbytes.php
 [2015-05-27 17:35 UTC] cmb@php.net
As of PHP 5.4.0 function is_file() expects a valid path instead of
a general string (ZPP p instead of s). paths, however, must not
contain null bytes. In case of an invalid pathname a respective
warning is thrown. See also <http://3v4l.org/0TFFl>.

With regard to the return value there's already a note on the
"Internal (built-in) functions" man page[1]:

| If the parameters given to a function are not what it expects,
| such as passing an array where a string is expected, the return
| value of the function is undefined. In this case it will likely
| return NULL but this is just a convention, and cannot be relied
| upon.

I'm not sure if there is the need for further documentation.

[1] <http://php.net/manual/en/functions.internal.php>
 [2016-09-09 16:47 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2016-09-09 16:47 UTC] cmb@php.net
> I'm not sure if there is the need for further documentation.

Actually, I'm rather sure that there's no need for further
documentation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC