#58856 closed defect (bug) (invalid)
There is str_contains() in wp-login.php.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Login and Registration | Keywords: | |
| Focuses: | Cc: |
Description (last modified by )
You should revert to strpos() since str_contains() is from php8.0.
WordPress6.3 RC1
wp-login.php
} elseif ( str_contains( $redirect_to, 'about.php?updated' ) ) {
$errors->add( 'updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to see what’s new.' ), 'message' );
} elseif ( WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED === $action ) {
$errors->add( 'enter_recovery_mode', __( 'Recovery Mode Initialized. Please log in to continue.' ), 'message' );
} elseif ( isset( $_GET['redirect_to'] ) && str_contains( $_GET['redirect_to'], 'wp-admin/authorize-application.php' ) ) {
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hi @nendeb55, thanks for opening this ticket.
str_contains()was polyfilled in WordPress 5.9 (changeset [52039]) along with several others such asstr_starts_with(),str_ends_with(),array_key_first()andarray_key_last().These can all be used safely as long as
/wp-includes/compat.phphas been included somewhere in the callstack, which is the case withwp-login.php.As this is used safely in the mentioned file, I'll close this ticket as
invalid.