Skip to content

Commit

Permalink
Use strpos instead of str_contains
Browse files Browse the repository at this point in the history
str_contains is PHP 8 only while strpos works on older versions of PHP

Fixes #431
  • Loading branch information
mrsdizzie committed Aug 14, 2024
1 parent 189e264 commit b14d625
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Plugin_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ protected function get_wporg_data( $plugin_name ) {

// Check the last update date.
$r_body = wp_remote_retrieve_body( $request );
if ( str_contains( $r_body, 'pubDate' ) ) {
if ( strpos( $r_body, 'pubDate' ) !== false ) {
// Very raw check, not validating the format or anything else.
$xml = simplexml_load_string( $r_body );
$xml_pub_date = $xml->xpath( '//pubDate' );
Expand Down

0 comments on commit b14d625

Please sign in to comment.