global $base_url is not necessarily a domain

Created on 18 February 2025, about 2 months ago

Problem/Motivation

The module uses the global $base_url to determine whether to show the pop-up:

    global $base_url;

    $domains_list = str_replace(["\r\n", "\r"], "\n", $config->get('domains_list'));
    $domains_list = explode("\n", $domains_list);
    $domains_list = preg_replace('{/$}', '', $domains_list);
    $domain_match = in_array($base_url, $domains_list);

However, $base_url can also include subfolders if that's where Drupal is installed. For example on my local dev, Drupal is at:

> http://localhost:8888/waltham-current/web

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024