Newlines in config.php corrupt binary files

tl;dr: In unsupported host installations, any content in config.php above the “<?php” line will cause downloaded binary files (like favicons) to be corrupted.

This is, of course, neither a bug nor a supported configuration. I just wanted to mention this for any other folks still running host installations.

After I made some changes to my configuration, my favicons stopped displaying. After poking around for a while, I figured out there was a newline at the beginning of the PNG files that shouldn’t have been there. Turns out that anything in the config.php file that’s outside of the “<?php” tag will make it through to any (?) files that tt-rss outputs. A newline had snuck into config.php while I was making my changes and it was breaking the binary image files.

Stupid mistake that took entirely too long to figure out. Another reason to run the Docker version, I guess.

that’s just how php works, it concatenates everything to output. this is also why using closing php tags (at end of file) is an antipattern because it leads to similar hard to find problems.