Plugin Directory

Changeset 3315332


Ignore:
Timestamp:
06/20/2025 02:26:31 PM (8 months ago)
Author:
jumptech
Message:

fix preemptive block compatibility with elementor editing page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • avacy/trunk/src/PreemptiveBlock.php

    r3290531 r3315332  
    1515        // do a get request
    1616        $blackList = [];
    17         $url = 'https://assets.avacy-cdn.com/config/' . get_option('avacy_tenant') . '/' . get_option('avacy_webspace_key') . '/custom-vendor-list.json';
     17
     18        $webSpaceKey = get_option('avacy_webspace_key');
     19        $tenant = '';
     20        if(!empty($webSpaceKey)) {
     21            if (strpos($webSpaceKey, '|') === false) {
     22                $tenant = get_option('avacy_tenant');
     23            } else {
     24                $parts = explode('|', $webSpaceKey);
     25                $tenant = $parts[0];
     26                $webSpaceKey = $parts[1];
     27            }
     28        }
     29
     30        if(empty($tenant) || empty($webSpaceKey)) {
     31            return;
     32        }
     33
     34        $url = 'https://assets.avacy-cdn.com/config/' . $tenant . '/' . $webSpaceKey . '/custom-vendor-list.json';
    1835        // $url = 'https://avacy-cdn.s3.eu-central-1.amazonaws.com/config/test-production/90990663-c953-493f-9311-97aeef0833dc/custom-vendor-list.json';
    1936        $customVendorListRequest = wp_remote_get($url);
     
    5976   
    6077        if (!empty($buffer)) {
    61              // Escape ampersands not part of entities
    62             $buffer = preg_replace('/&(?![a-zA-Z0-9#]+;)/', '&', $buffer);
    6378       
    6479            $dom = new DOMDocument();
Note: See TracChangeset for help on using the changeset viewer.