Problem/Motivation

Config variables popup_bg_hex or popup_text_hex can be set to 000 (integer) rather than '000' (string). If they are, then CSS like this gets generated:

.eu-cookie-withdraw-tab { color: #0;}

#0 is an invalid CSS color value leading to a validation error.

Proposed resolution

In eu_cookie_compliance.module in the color overrides, instead of checking that popup_bg_hex and popup_text_hex are not empty strings, it should check that they match a suitable regex.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Liam Morland created an issue. See original summary.

liam morland’s picture

Version: 2.0.x-dev » 8.x-1.x-dev

This code has been removed from 2.0.x.

liam morland’s picture

Status: Active » Needs review

Html::escape() is no longer required because the regex checks that the value is free of prohibited characters.

svenryen’s picture

Thanks for the MR, Liam!

We'll take a look later this summer.

svenryen’s picture

Assigned: Unassigned » svenryen

svenryen’s picture

Status: Needs review » Fixed

Tested this. Works like a charm, thanks for the patch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.