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
Use IpHelper to get IP in Logger #25520
Conversation
Failing tests related to framework. Submitted PR there joomla-framework/utilities#23. |
I can't test because I don't have a reverse proxy. @twrhills As you had the issue handled by this PR, could you test? |
@richard67 I have tested this and it is the correct solution for my case. I am unfamiliar with github so if you need me to confirm in another way I would be grateful if you can link documentation / instructions. |
Thank you for testing! Please mark your test here: https://issues.joomla.org/tracker/joomla-cms/25520 |
@twrhills Follow the link posted in comment before by Quy, then click the "Test this" button at the top left corner above the description, then in the "Submit test result" select your test result with the check box, then click "Submit test result" button below the text field for the (otional) comment. |
I have tested this item ✅ successfully on 6ed695e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25520. |
I have tested this item ✅ successfully on 6ed695e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25520. |
Status "Ready To Commit". |
@SharkyKZ can you please fix the error messages found by travis?
|
@HLeithner need to update Framework's Utilities package to fix the notice. Submitted a separate PR #25601. |
@SharkyKZ thx for the info so this is RTC when the composer update is merged. |
I created pr #26000 please test. |
@HLeithner Ist this a duplicate then to @SharkyKZ 's PR #25601 ? |
@richard67 almost. But just realized my PR reverts some changes to Composer (I was using older version). So I'll close it. |
@SharkyKZ IpHelper::getIp(); seams to behave different then the current code in the testing. Could you please have a look? |
@HLeithner should I change the PR so it does not break tests or update tests? |
The tests should be updated. I’m going to take a wild guess that superglobal values aren’t being properly set and reset. |
There's also discrepancy between empty IP values. Before it was |
The w3c logger returned - with the old code now it shows an empty stringand I think thats wrong. So the null seams to be right. |
Added empty string check in the logger. |
Thanks |
Pull Request for Issue #25518 .
Summary of Changes
Use IpHelper to get IP in
Joomla\CMS\Log\Logger\FormattedtextLogger
.Testing Instructions
Install Joomla behind a reverse proxy which provides both remote_addr and http_x_forwarded_for headers.
Perform a login failure on /administrator
Check the /logs/error.php log
Expected result
To see the ip address from http_x_forwarded_for reported as the offending IP address.
Actual result
To see the ip address from remote_addr reported as the offending IP address.
Documentation Changes Required
No.