Fix PHP notices in CLI coming from the WebAuthn plugin#38340
Merged
wilsonge merged 4 commits intojoomla:4.2-devfrom Sep 5, 2022
nikosdion:fix/webauthn-notices-cli
Merged
Fix PHP notices in CLI coming from the WebAuthn plugin#38340wilsonge merged 4 commits intojoomla:4.2-devfrom nikosdion:fix/webauthn-notices-cli
wilsonge merged 4 commits intojoomla:4.2-devfrom
nikosdion:fix/webauthn-notices-cli
Conversation
Contributor
|
I have tested this item ✅ successfully on 25c73da This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38340. |
Member
|
I have tested this item ✅ successfully on 25c73da This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38340. |
Member
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38340. |
Member
|
Is this one still valid with #38524 being merged? |
Contributor
|
It will be in old style CLI apps. Plus it's better that this doesn't apply in API Apps anyhow - which even though it doesn't error - currently web auth will still run without this patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR aims to fix some PHP notices when running under CLI. In that case, if a form is loaded (for example to gather the default data), the
onContentPrepareFormevent is fired. The WebAuthn plugin kicks in, tries to read the current URL and a notice is raised.This PR will double check that we are in a web environment before continuing the execution
Testing Instructions
The best way to test it is to have a small script that tries to load an XML form. Sadly at the moment I don't have any, I came across this bug by developing CLI commands for the next version of Admin Tools.
Actual result BEFORE applying this Pull Request
PHP notice:
Expected result AFTER applying this Pull Request
No PHP notice
Documentation Changes Required
None