User tests: Successful: Unsuccessful:
Pull Request for Issue #25518 .
Use IpHelper to get IP in Joomla\CMS\Log\Logger\FormattedtextLogger
.
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
To see the ip address from http_x_forwarded_for reported as the offending IP address.
To see the ip address from remote_addr reported as the offending IP address.
No.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
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
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Status "Ready To Commit".
Labels |
Added:
?
|
@SharkyKZ can you please fix the error messages found by travis?
- JLogLoggerFormattedTextTest::testAddEntry
Undefined index: REMOTE_ADDR
/home/travis/build/joomla/joomla-cms/tests/unit/core/helper.php:55
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:488
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:440
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:57
/home/travis/build/joomla/joomla-cms/libraries/src/Log/Logger/FormattedtextLogger.php:195
/home/travis/build/joomla/joomla-cms/libraries/src/Log/Logger/FormattedtextLogger.php:171
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/joomla/log/loggers/JLogLoggerFormattedTextTest.php:174- JLogLoggerFormattedTextTest::testDeferWritingEntry
Undefined index: REMOTE_ADDR
/home/travis/build/joomla/joomla-cms/tests/unit/core/helper.php:55
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:488
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:440
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:57
/home/travis/build/joomla/joomla-cms/libraries/src/Log/Logger/FormattedtextLogger.php:195
/home/travis/build/joomla/joomla-cms/libraries/src/Log/Logger/FormattedtextLogger.php:139
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/joomla/log/loggers/JLogLoggerFormattedTextTest.php:237- JLogLoggerW3CTest::testAddEntry
Undefined index: REMOTE_ADDR
/home/travis/build/joomla/joomla-cms/tests/unit/core/helper.php:55
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:488
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:440
/home/travis/build/joomla/joomla-cms/libraries/vendor/joomla/utilities/src/IpHelper.php:57
/home/travis/build/joomla/joomla-cms/libraries/src/Log/Logger/FormattedtextLogger.php:195
/home/travis/build/joomla/joomla-cms/libraries/src/Log/Logger/FormattedtextLogger.php:171
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/joomla/log/loggers/JLogLoggerW3CTest.php:37
@HLeithner need to update Framework's Utilities package to fix the notice. Submitted a separate PR #25601.
@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.
@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 null
, now it's an empty string
Category | Libraries | ⇒ | Libraries Unit Tests |
Labels |
Added:
?
|
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.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-10-29 14:26:36 |
Closed_By | ⇒ | HLeithner |
Thanks
Failing tests related to framework. Submitted PR there joomla-framework/utilities#23.