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

[3.10] [PHP 8.1] deprecated header() in WebApplication #36728

Merged
merged 2 commits into from
Jan 18, 2022

Conversation

beat
Copy link
Contributor

@beat beat commented Jan 18, 2022

Pull Request for Issue # .

Summary of Changes

Fixes PHP 8.1 deprecation warning in Joomla 3.10.

Note in Joomla 4.0: Same PHP 8.1 deprecated issue is in libraries/vendor/joomla/application/src/AbstractWebApplication.php line 886 but it doesn't appear.

Testing Instructions

Use PHP 8.1 in Joomla 3.10
Enable debug mode (without Debug plugin enabled!) (not sure if CB also imight be needed to reproduce).
Go to administration home page

Actual result BEFORE applying this Pull Request

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in libraries/src/Application/WebApplication.php on line 1101

Expected result AFTER applying this Pull Request

No warning.

Documentation Changes Required

None.

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@PhilETaylor

This comment was marked as abuse.

@beat
Copy link
Contributor Author

beat commented Jan 18, 2022

Joomla 4 has

header(str_replace(\chr(0), '', $string), $replace, $code);

maybe that could be back ported into Joomla 3.10 with this PR? No?

That zero-chars replacement is already in Joomla 3.10, even written cleaner, as a separate line:

https://github.com/joomla/joomla-cms/pull/36728/files#diff-1025beca1d0f857cf456d164a0dac843df258d41f804f39bc98270568b329936R1100

@PhilETaylor

This comment was marked as abuse.

@beat
Copy link
Contributor Author

beat commented Jan 18, 2022

No worries, checked before committing too to make sure that security-wise we're fine! 😉

Ah sorry missed that

@zero-24 zero-24 added this to the Joomla 3.10.6 milestone Jan 18, 2022
@zero-24
Copy link
Contributor

zero-24 commented Jan 18, 2022

Will take this for 3.10.6 thanks @beat

@zero-24 zero-24 merged commit b2206b0 into joomla:3.10-dev Jan 18, 2022
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.

None yet

5 participants