Skip to content

eBird CSV export corrupted by PHP 8.4 deprecation warning in history.php #4

@RewildBirder

Description

@RewildBirder

About this report

First time filing a GitHub issue — happy to provide any additional
information or clarification if the format or detail isn't quite right.

I'm a hobbyist running BirdNET-Pi Enhanced Version on a Raspberry Pi
for backyard bird detection. I noticed the eBird export was broken and
tracked down the cause before reporting.

Bug

The eBird CSV export (result_file.csv) is unusable for eBird import because
PHP 8.4 deprecation warnings are injected before every data row.

Error printed before each data row

<br />
<b>Deprecated</b>: fputcsv(): the $escape parameter must be provided as its
default value will change in
<b>/home/birder/BirdNET-Pi/scripts/history.php</b> on line <b>60</b><br />

Impact

eBird's importer cannot parse the file and reports errors on every row:

  • "Row N, Column 6: Location name is required"
  • "Row N, Column 9: Observation date is required"

The data itself is correct — location, date, lat/lon are all present in the
actual CSV rows. The warnings simply make the file unparseable.

Root cause

fputcsv() on line 60 of scripts/history.php is missing the explicit $escape
parameter. PHP 8.4 changed the default and now emits a deprecation warning
to stdout, which lands directly in the CSV output.

Confirmed via grep — fputcsv is called exactly once in the file:

60: fputcsv($output, $row);

Fix

// Before (line 60)
fputcsv($output, $row);

// After
fputcsv($output, $row, ',', '"', '\\');

Reproduction

Reproduced across all exports tested (April 25, 26, and 27, 2026).
Affects every data row in every export — not intermittent.

Environment

  • BirdNET-Pi Enhanced Version (zach7036 fork), fresh install ~April 2026
  • PHP 8.4.16 (built by Debian, Dec 18 2025)
  • Raspberry Pi OS Trixie

Note: This will affect all users on Trixie, which ships PHP 8.4 by default.
Users on older OS versions running PHP 8.3 or below will not see this issue,
which likely explains why it hasn't been reported until now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions