Skip to content

[SITE-5428] check for SimpleSAML\Auth\Simple object before finding its autoloader (Attempt II) - #444

Merged
pwtyler merged 9 commits into
developfrom
reapply-414
Dec 19, 2025
Merged

pwtyler merged 9 commits into
developfrom
reapply-414

Conversation

@pwtyler

@pwtyler pwtyler commented Dec 5, 2025 •

Copy link
Copy Markdown
Member

PR #414 was merged to develop without running all of its CI (coming from a fork) and still needed work. It was backed out in #443 and re-applied here to address with fixes for testing.

From original PR:

Prior to 2.2.0, we were relying the Composer autoloader to load the SimpleSAML\Auth\Simple object. But, we also had a bug in our code that meant when the plugin searched for an autoloader, it woudln't find it. That bug was hidden for years, but with 2.2.0 and the addition of a call to log_error when WP_DEBUG is set revealed it to us.

This PR checks for the existence of the object prior to looking for an autoloader. If the object exists, likely due to the Composer autoloader, then the plugin simply uses it without looking for a different loader. But, if it doesn't exist, then it'll fall back on the original login within 2.2.0.

pwtyler and others added 2 commits December 5, 2025 14:34
… (re-apply)

---------
Co-authored-by: David Dashifen Kees <dashifen@dashifen.com>
@AnaisPantheor
AnaisPantheor marked this pull request as ready for review December 18, 2025 16:20
@AnaisPantheor
AnaisPantheor requested a review from a team as a code owner December 18, 2025 16:20
Check for both SimpleSAML\Auth\Simple (2.x) and SimpleSAML_Auth_Simple
(1.18) before attempting to find and load the autoloader. This fixes
the case where SimpleSAMLphp 1.18 is already autoloaded but the code
only checked for the 2.x namespace class.
Comment thread inc/class-wp-saml-auth.php Outdated
* @param string $path Path to autoloader
* @return void
*/
protected function maybe_log_error( $path = '' ) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is not a generic error wrapper, but an autoload error— method name should be more specific.

@AnaisPantheor
AnaisPantheor self-requested a review December 18, 2025 19:52
@AnaisPantheor AnaisPantheor changed the title check for SimpleSAML\Auth\Simple object before finding its autoloader (Attempt II) [SITE-5428] check for SimpleSAML\Auth\Simple object before finding its autoloader (Attempt II) Dec 18, 2025
Comment thread README.md Outdated
Comment thread readme.txt Outdated
@pwtyler
pwtyler merged commit eab271d into develop Dec 19, 2025
33 of 36 checks passed
@pwtyler
pwtyler deleted the reapply-414 branch December 19, 2025 19:56
AnaisPantheor added a commit that referenced this pull request Jan 8, 2026
#444)

---------

Co-authored-by: David Dashifen Kees <dashifen@dashifen.com>
Co-authored-by: Anais Gueyte <anaisgueyte@pantheon.io>
AnaisPantheor added a commit that referenced this pull request Jan 8, 2026
#444)

---------

Co-authored-by: David Dashifen Kees <dashifen@dashifen.com>
Co-authored-by: Anais Gueyte <anaisgueyte@pantheon.io>
AnaisPantheor added a commit that referenced this pull request Jan 9, 2026
#444)

---------

Co-authored-by: David Dashifen Kees <dashifen@dashifen.com>
Co-authored-by: Anais Gueyte <anaisgueyte@pantheon.io>
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.

2 participants