Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix headers already sent error in version 3.7.4 #376

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

anktd
Copy link
Collaborator

@anktd anktd commented Jul 15, 2024

The debug log shared by merchant here shows a php warning about "Headers already sent"

PHP Warning: Cannot modify header information - headers already sent by (output started at /homepages/44/MDSP/htdocs/wordpress/wp-content/plugins/blockonomics-bitcoin-payments/php/form_fields.php:1) in /homepages/44/MDSP/htdocs/wordpress/wp-includes/http.php on line 505

This is caused by empty line before php tag declaration in php/form_fields.php file. This is causing php functions that need to send HTTP headers (like setcookie(), session_start(), or header()) to fail because content has already been sent to the browser.

This file also had missing ABSPATH check. Without this check, if someone knows the file's URL, they could potentially access and execute the file directly, making this a potential security risk. I've added this statement in this PR to fix this.

@anktd anktd requested a review from ashthecoder05 July 15, 2024 07:50
@anktd
Copy link
Collaborator Author

anktd commented Jul 15, 2024

Added fix from #375 about the deprecation warning for api_key variable for websites using php version 8.2 onwards.

Copy link
Collaborator

@ashthecoder05 ashthecoder05 left a comment

Choose a reason for hiding this comment

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

all the changes looks good

@shivaenigma shivaenigma merged commit 5ff6803 into blockonomics:master Jul 15, 2024
1 check passed
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.

3 participants