facebook / facebook/hhvm

Respect auto_detect_line_endings ini setting

Open
#2,897 1 comment 0 reactions 0 assignees View on GitHub
ini low-pri php5 incompatibility
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

The logic of File::readLine(), which is used to implement fgets() in userland, implements the Mac lining detection logic of 'auto_detect_line_endings'. Note that 'auto_detect_line_endings' defaults to being off in stock PHP and causes bugs with fgets() when packets are split in "unlucky" ways. See http://www.php.net//manual/en/function.fgets.php#101963.

This has resulted in at least one bug in the Redis extension (https://github.com/facebook/hhvm/pull/2874). I don't know what else might be broken.

The whole existence of the ini setting in PHP was probably a design mistake, so it's tempting to recommend just deleting the code...though for feature parity I guess the best option is to support the PHP ini behavior.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.