Skip to content

2.1.1

Latest

Choose a tag to compare

@rollecode rollecode released this 06 Aug 14:04
· 1 commit to master since this release

Fixes every PHP warning and deprecation the plugin raised during a login on PHP 8.x. Verified against WordPress 7.0.2 on PHP 8.3 with a stubbed SSO API, before and after.

  • Give the shadow user a random password instead of null. wp_insert_user() raised "The user_pass field is required when creating a new user" on every shadow user creation and put the account into the password reset flow with an empty password. The password is never usable, since WordPress login and password resets are already blocked for SSO users
  • Fix "Undefined array key user_nicename" for SSO users that have a lastname but no firstname
  • Take the first character of the lastname with mb_substr() instead of a byte offset, which cut Ä, Ö and Å in half. A member named Öhman produced the initial "a", now correctly "o"
  • Bail out of capture_login_redirect() when get_user_data_for_wp() returns false, instead of assigning an array key on it. That is deprecated since PHP 8.1 and an error in PHP 9. It is reachable whenever the SSO service fails partway through a login, which makes about five API calls
  • Guard $sso_user->id, $sso_user->idp and $sso_user->local_id before reading them, so a malformed SSO response fails cleanly instead of raising undefined property warnings
  • Read the request path with wp_parse_url( ..., PHP_URL_PATH ) in capture_sso_logout(), so a REQUEST_URI without a path no longer raises an undefined key warning and passes null to rtrim()
  • Fire avoine_sso_login\user\prevented_password_reset\email on the branch where the email is actually prevented. It used to fire only when the email was allowed through
  • Use time() instead of wp_date( 'U' ) for the shadow user login suffix

No API changes. All hook and filter names are unchanged.