Bug #78535 [PATCH]: auto_detect_line_endings value not parsed as bool
| From: | bugreportuser+php.bugs@gmail.com | Date: | Fri, 13 Sep 2019 21:43:51 +0000 |
| Subject: | Bug #78535 [PATCH]: auto_detect_line_endings value not parsed as bool | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222741@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78535&edit=1
ID: 78535
Patch added by: bugreportuser+php.bugs@gmail.com
Reported by: bugreportuser+php dot bugs at gmail dot com
Summary: auto_detect_line_endings value not parsed as bool
Status: Open
Type: Bug
Package: *Configuration Issues
Operating System: any
PHP Version: 7.2.22
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix auto_detect_line_endings type
On GitHub: https://github.com/php/php-src/pull/4700
Patch: https://github.com/php/php-src/pull/4700.patch
Previous Comments:
------------------------------------------------------------------------
[2019-09-13 21:42:51] bugreportuser+php dot bugs at gmail dot com
Description:
------------
Setting "auto_detect_line_endings" to "on" with "ini_set" doesn't
enable it, because the value's parsed as a long.
This bug has a pull request.
Test script:
---------------
<?php
ini_set("auto_detect_line_endings", "on");
var_dump(ini_get("auto_detect_line_endings"));
$filePath = __DIR__ . DIRECTORY_SEPARATOR . "auto_detect_line_endings_2.txt";
file_put_contents($filePath, "fooBar1\rfooBar2\rfooBar3");
$stdin = fopen($filePath, "r");
var_dump(fgets($stdin));
Expected result:
----------------
string(2) "on"
string(8) "fooBar1"
Actual result:
--------------
string(2) "on"
string(23) "fooBar1fooBar2fooBar3"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78535&edit=1