Skip to content

Open file in binary mode in InputFile::fromLocalFile() method#190

Merged
vjik merged 1 commit intomasterfrom
file
Mar 10, 2026
Merged

Open file in binary mode in InputFile::fromLocalFile() method#190
vjik merged 1 commit intomasterfrom
file

Conversation

@vjik
Copy link
Copy Markdown
Member

@vjik vjik commented Mar 10, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates file handling in the InputFile type to ensure local files are opened in binary mode, improving cross-platform correctness (notably on Windows) when sending files via the Telegram Bot API.

Changes:

  • Open local files using fopen($path, 'rb') in InputFile::fromLocalFile().
  • Add a changelog entry documenting the enhancement for the next patch release.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Type/InputFile.php Switches local file opening mode from text to binary (rrb).
CHANGELOG.md Documents the enhancement under the upcoming 0.17.1 section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vjik vjik merged commit c3828aa into master Mar 10, 2026
22 checks passed
@vjik vjik deleted the file branch March 10, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants