php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78535 auto_detect_line_endings value not parsed as bool
Submitted: 2019-09-13 21:42 UTC Modified: 2019-09-14 16:50 UTC
From: bugreportuser+php dot bugs at gmail dot com Assigned: cmb (profile)
Status: Closed Package: *Configuration Issues
PHP Version: 7.2.22 OS: any
Private report: No CVE-ID: None
 [2019-09-13 21:42 UTC] 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"

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-13 21:43 UTC] bugreportuser+php dot bugs at gmail dot com
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
 [2019-09-14 16:49 UTC] cmb@php.net
Automatic comment on behalf of 37939393+bugreportuser@users.noreply.github.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fdcca930561babde7fe46cb51215ca9422dea09f
Log: Fix #78535: auto_detect_line_endings value not parsed as bool
 [2019-09-14 16:49 UTC] cmb@php.net
-Status: Open +Status: Closed
 [2019-09-14 16:50 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 16 08:01:27 2024 UTC