Skip to content

Commit

Permalink
Fix undefined str_starts_with with PHP 7 (#1334)
Browse files Browse the repository at this point in the history
Requires PHP 8.0+.
  • Loading branch information
herrvigg committed May 1, 2023
1 parent c9b110b commit 48030c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/url.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function qtranxf_language_neutral_path( string $path ): bool {
}
// WordPress doesn't provide the partial path to wp-admin or login, so check those from the site URL.
$site_url_path = site_url( $path );
if ( str_starts_with( $site_url_path, admin_url() ) ||
if ( strpos( $site_url_path, admin_url() ) === 0 ||
$site_url_path === wp_login_url() ||
preg_match( '#^/(wp-.*\.php|xmlrpc.php|robots.txt|oauth/)#', $path ) ||
qtranxf_ignored_file_type( $path )
Expand Down

0 comments on commit 48030c2

Please sign in to comment.