Skip to content

Commit d3cb681

Browse files
iodicvahidkay-meta
authored andcommitted
fix(compat): replace str_ends_with with substr for PHP 7 support
1 parent 519df31 commit d3cb681

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

facebook-for-woocommerce.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ private static function compat_is_expected_host( string $url ): bool {
524524

525525
$host = wp_parse_url( $url, PHP_URL_HOST );
526526

527-
return $host && str_ends_with( $host, '.' . self::PLUGIN_NAME_DNS );
527+
$suffix = '.' . self::PLUGIN_NAME_DNS;
528+
return $host && substr( $host, -strlen( $suffix ) ) === $suffix;
528529
}
529530

530531

0 commit comments

Comments
 (0)