Skip to content

Commit

Permalink
PHPCS: Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
theodesp committed Feb 27, 2024
1 parent 806a20b commit ffd2cdd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions plugins/faustwp/includes/utilities/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ function plugin_version() {
*/
function domains_match( $domain1, $domain2 ) {
// Extract the domain part
$extract_domain = function ( $url ) {
$parsed_url = wp_parse_url( $url, PHP_URL_HOST );
return $parsed_url ? $parsed_url : null;
};
$extract_domain = function ( $url ) {
$parsed_url = wp_parse_url( $url, PHP_URL_HOST );
return $parsed_url ? $parsed_url : null;
};

$domain1 = $extract_domain( $domain1 );
$domain2 = $extract_domain( $domain2 );
$domain1 = $extract_domain( $domain1 );
$domain2 = $extract_domain( $domain2 );

// Remove "www" prefix from domain if present
$domain1 = preg_replace('/^www\./i', '', $domain1);
$domain2 = preg_replace('/^www\./i', '', $domain2);
$domain1 = preg_replace( '/^www\./i', '', $domain1 );
$domain2 = preg_replace( '/^www\./i', '', $domain2 );

return $domain1 !== null && $domain2 !== null && $domain1 === $domain2;
return $domain1 !== null && $domain2 !== null && $domain1 === $domain2;
}

0 comments on commit ffd2cdd

Please sign in to comment.