Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: allow installing also on elementor.com sub domains [TMZ-256][TMZ-288] #152

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ public static function has_pro(): bool {
return defined( 'ELEMENTOR_PRO_VERSION' );
}

public static function are_we_on_elementor_domains() {
public static function are_we_on_elementor_domains(): bool {
$current_domain = filter_input( INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_URL );
$allowed_domains = [
'elementor.com' => true,
'elementor.red' => true,
'elementor.com',
'elementor.red',
];

return isset( $allowed_domains[ $current_domain ] );
foreach ( $allowed_domains as $domain ) {
if ( str_ends_with( $current_domain, $domain ) ) {
return true;
}
}
return false;
}

public static function has_hello_biz(): bool {
Expand Down
Loading