Skip to content

Enhanced RGBA color validation - #4718

Merged
vytisbulkevicius merged 9 commits into
developmentfrom
bugfix/rgba-function-color-structure
Nov 26, 2026
Merged

vytisbulkevicius merged 9 commits into
developmentfrom
bugfix/rgba-function-color-structure

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Summary

Improved CSS function color validation and sanitization by refining the detection regex to handle a broader range of valid and invalid color values. Expanded test coverage to cover additional edge cases and ensure more reliable color handling.

Check before Pull Request is ready:

Closes #4706 (comment)

@pirate-bot

pirate-bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Plugin build for b0b000c is ready 🛎️!

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes requested

The stricter color check works, but the ability routes still store malformed colors without it.

  • inc/abilities/site_set_theme_mod.php:175 — correctness The ability routes store color fields without the color check this PR tightens. site_set_theme_mod saves set_theme_mod( $key, $this->sanitize_value( $input['value'] ) ) at line 175, and sanitize_value() only runs text sanitization (lines 191-200). The header and footer row-style abilities do the same for text_color, background.colorValue and background.overlayColorValue (inc/abilities/builder_configure.php:188-194). So rgb(1.2.3,4,5), which neve_sanitize_colors() now rejects, is stored and printed as a CSS variable (inc/core/styles/css_prop.php:227-242). Run each color-bearing field of these abilities through neve_sanitize_colors() before storage, and reject the call when it returns ''. Add ability tests that send rgb(1.2.3,4,5) to each route.
Validation details
  • Files reviewed: 2/2 changed files.
  • The sanitization class passes at HEAD in a WordPress sandbox with PHP 8.3: cd /var/www/html/wp-content/themes/neve && set -o pipefail; timeout 900 phpunit --do-not-cache-result --filter 'TestSani… printed OK (12 tests, 145 assertions) (run R9)
  • Both changed tests fail with the pr-base sanitizer, so they detect the change: set -o pipefail; T=/var/www/html/wp-content/themes/neve; cd $T && timeout 900 phpunit --do-not-cache-result --filter 'Te… printed Failures: 2 (run R12)
  • An isolated run compared the old and new patterns on 28 inputs. Only invalid CSS values changed to rejected, and long inputs showed no backtracking: timeout 30 php /workspace/checks/C3/check.php | tee /workspace/checks/C3/output.txt (run R7, exit 0)
Untested areas
  • Malformed colors inside var() fallbacks and gradients still pass neve_sanitize_colors(). No color picker was found that emits them, so this stays unconfirmed.
  • Palette colors saved under the old pattern were not traced to a real producer.
  • WordPress versions between 5.5 and 7.1 were not read.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • assets/apps/components/src/Common/ColorPickerFix.js:53-66 — unverified: deciding whether malformed user input survives requires the version-matched WordPress ColorPicker.commitValues/GradientPicker contract. Preview outputs themselves interpolate value…
    • assets/apps/components/src/Controls/ColorControl.js:46-52,175-181 — unverified: deciding whether malformed user input survives requires the version-matched WordPress ColorPicker.commitValues/GradientPicker contract. Preview outputs themselves interpolate value…
    • class-wp-customize-setting.php:650-660,657-667 — unverified:
    • /deps/wordpress/5.5/wp-includes/class-wp-customize-setting.php:650-660 — unverified: persistence routing is established at 5.5 and 7.1: saving obtains post_value() after configured sanitization (:518-521 and :525-528; manager guards below). Corresponding source for…
    • /deps/wordpress/7.1/wp-includes/class-wp-customize-setting.php:657-667 — unverified: persistence routing is established at 5.5 and 7.1: saving obtains post_value() after configured sanitization (:518-521 and :525-528; manager guards below). Corresponding source for…
    • not reached: complete server-rendering path for header-footer-grid/Core/Components/Utility/SearchIconButton.php:239-267

🤖 Automated review · run code-review-agent_6b0564ed20f950.57009720.


🤖 Review agent — review posted ✅ on bebe609c · changes requested · 1 finding · 32 min

Run code-review-agent_6b0564ed20f950.57009720 · trail

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes requested

The new checks fix most ability color routes. The menu icon button appearance colors still skip the color check.

Questions for the author

  • Issue #4708 reports that the Customizer row Text Color is cleaned only with wp_filter_nohtml_kses. Is that setting checked as a color anywhere before it reaches the CSS?
Validation details
  • Files reviewed: 8/8 changed files. One question was not settled: "Failure direction: Too strict".
  • The new ability tests pass at HEAD: set -o pipefail; cd /repo && git status --short | head -3; rm -rf /workspace/ab && mkdir -p /workspace/ab/head/themes /… printed OK (6 tests, 22 assertions) (run R5)
  • Four of them fail with the pr-base code, so they detect the change: set -o pipefail; cd /workspace/ab/head/themes/neve && timeout 280 phpunit --do-not-cache-result --testdox --filter 'Test… printed Tests: 6, Assertions: 14, Failures: 4. (run R6)
  • The earlier finding is fixed for builder rows and for _color and _background keys.
Untested areas
  • "Failure direction: Too strict" was not settled for the background check.
  • The color pickers in ColorPickerFix.js and ColorControl.js were not traced to the values they emit.
  • WordPress versions between 5.5 and 7.1 were not read.
  • Import and migration color copies were not traced.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • class-wp-customize-setting.php:650-660,657-667 — unverified: The unversioned place resolves to the two endpoint versions ruled above; behavior at intermediate supported WordPress versions was not read.
    • not reached: migration/import writes in inc/core/admin.php:1097 and header-footer-grid/functions-migration.php:84
    • assets/apps/components/src/Common/ColorPickerFix.js:53-66 — unverified: Presence-only checks reach inherited commitValues(colors). Whether malformed numeric components survive that implementation remains unknown; version-matched readable @wordpress/com…
    • assets/apps/components/src/Controls/ColorControl.js:46-52,175-181 — unverified: RGB interpolation and gradient forwarding lack local structural validation, but whether the upstream pickers emit malformed components remains unresolved. The dependency range in p…

🤖 Automated review · run code-review-agent_6b056e5b78b701.95767916.


🤖 Review agent — review posted ✅ on a4f93901 · changes requested · 2 findings · 21 min

Run code-review-agent_6b056e5b78b701.95767916 · trail

Comment thread inc/abilities/site_set_theme_mod.php Resolved

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes requested

The earlier findings are fixed. Four color paths outside the diff still store malformed colors and need the same check.

  • inc/abilities/appearance_update.php:585 — correctness The appearance ability still stores malformed hex button colors. Its check accepts any hex of 3 to 8 digits, so buttons.primary.background: "#12345" or a 7-digit value is saved to neve_button_appearance (lines 535-559). That value reaches --primarybtnbg unchanged and the browser drops it. Validate every button field (background, text and their hover values, primary and secondary) with neve_sanitize_colors(). Reject a non-empty value it returns as ''. Add a case in tests/test-neve-ability-color-inputs.php that sends #12345 for each field and expects the request to fail.
  • header-footer-grid/Core/Builder/Abstract_Builder.php:531 — correctness The header and footer row Text Color is still not checked as a color. Its setting uses 'sanitize_callback' => 'wp_filter_nohtml_kses', which only strips HTML. The saved value is printed as --color without escaping (Abstract_Builder.php:1040-1043, css_prop.php:227-242). So rgb(1.2.3,4,5) is stored, and #222;}body{background:lime}/* can close the rule and add CSS (issue #4708). Use neve_sanitize_colors as the callback for every row Text Color setting. Add tests in tests/test-neve-sanitization.php that sanitize a header row and a footer row Text Color with both values and expect ''.
  • inc/core/admin.php:1097 — correctness Switching from Neve to a child theme copies every theme mod without the new color checks. migrate_options() runs on after_switch_theme and copies stored values as they are. A color saved before this fix, such as rgb(1.2.3,4,5) in neve_scroll_to_top_icon_color, is copied and printed as --color in the child theme. Run each copied color, background and button appearance mod through its Customizer sanitizer before the copy, and drop a value it blanks. Add a test that stores a malformed color, runs migrate_options() for a child theme, and expects the copied mod to be empty.
  • globals/sanitize-functions.php:36 — correctness Malformed function colors still pass when they sit inside var() or a gradient. The var() fallback uses the loose $color_fn pattern [0-9a-z.,%\/\s-]+, and the gradient pattern accepts any such call. So var(--missing,rgb(1.2.3,4,5)) and linear-gradient(rgb(1.2.3,4,5),#fff) are saved unchanged and printed into CSS. Extend the component grammar of neve_is_css_function_color() to accept the valid slash alpha form, such as rgb(1 2 3 / 50%). Then check every rgb(), rgba(), hsl() and hsla() call inside a var() fallback or a gradient with that grammar. Add both malformed values to tests/test-neve-sanitization.php and expect ''.
Validation details
  • Files reviewed: 4/4 files changed since the prior review. Run code-review-agent_6b056e5b78b701.95767916 reviewed the other 4 files, not rerun.
  • The ability color tests pass at HEAD: du -sh /repo 2>/dev/null | tail -1; rm -rf /tmp/c3copy; git -C /repo worktree list; cp -a /repo /tmp/c3copy && cd /tmp/c… printed OK (10 tests, 39 assertions) (run R3)
  • The color sanitizer keeps nested malformed colors unchanged at HEAD and pr-base: timeout 30 php /workspace/checks/C8/run.php (run R9, exit 0)
  • Question for the author: CONTRIBUTING.md puts new unit tests under tests/php/unit. Is that rule outdated?
Untested areas
  • The valid button appearance test passed with the pr-base code. That run has no record.
  • The suite fails to load an unchanged menu icon test in the checkout. A clean copy passes.
  • The color picker scripts were not traced to the values they emit.
  • Only WordPress 5.5 and 7.1 were read. The child theme copy was checked on 7.1 only.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • not reached: previously unverified ColorPickerFix.js:53-66, ColorControl.js:46-52,175-181 and migration writes
    • assets/apps/components/src/Common/ColorPickerFix.js:53-66 — unverified: Presence checks forward components to inherited commitValues; the resolved upstream implementation and its numeric normalization remain unread.
    • assets/apps/components/src/Controls/ColorControl.js:46-52,175-181 — unverified: RGB interpolation and gradient forwarding depend on upstream picker output validation. JavaScript dependencies are absent (/workspace/review/context.md:79); the runtime component i…
    • class-wp-customize-setting.php:650-660,657-667 — unverified: WordPress 5.5 and 7.1 retain their supplied per-route rulings. Intermediate supported versions’ sanitize-before-write contracts remain unread; endpoint evidence does not establish …

🤖 Automated review · run code-review-agent_6b0575fabc1e97.12013384.


🤖 Review agent — review posted ✅ on a62cc7ba · changes requested · 6 findings · 45 min

Run code-review-agent_6b0575fabc1e97.12013384 · trail

Comment thread inc/abilities/site_set_theme_mod.php Resolved

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes requested

The earlier docblock, test, row color and hex findings are fixed, but the appearance ability now stores button colors with extra CSS.

  • inc/core/styles/css_prop.php:227-242 — correctness Colors stored before this fix, or written by an importer, are still printed without the color check. The custom property branch interpolates the stored value as it is. The palette output in inc/core/dynamic_css.php:179-220 concatenates palette values the same way. So a saved rgb(1.2.3,4,5) row, button or palette color keeps printing after the update. Templates Patterns Collection imports theme_mods and theme_mods_neve without Neve's sanitizers, with the same effect. Run color values through neve_sanitize_colors() before they are printed as custom properties and palette variables. Add a test that stores a malformed color mod and expects the generated CSS to omit it.

Questions for the author

  • Can any producer or stored setting supply gradient stops such as hsl(120deg, 50%, 50%) or rgb(var(--r),0,0)? The new gradient check now rejects both forms, which earlier versions saved.
Validation details
  • Files reviewed: 7/7 files changed since the prior review. The row "consumer: neve_sanitize_button_appearance() return changed" stays unchecked.
  • The color tests pass at HEAD in a clean copy: OK (27 tests, 228 assertions) (run R10).
  • The appearance ability stores the extra CSS: CSS_HAS_BODY_DISPLAY_NONE yes (run R13).
  • The child theme copy keeps a bad palette color: CHILD_PRIMARY_ACCENT "rgb(1.2.3,4,5)" (run R13).
Untested areas
  • The row "consumer: neve_sanitize_button_appearance() return changed" was not settled.
  • The stored-value output path was traced in source only.
  • The Beaver Builder palette consumer was not read.
  • Only WordPress 5.5 and 7.1 were read.
  • The test suite does not load in /repo. A clean copy passes.

🤖 Automated review · run code-review-agent_6b058dbc0b5838.96589553.


🤖 Review agent — review posted ✅ on 413f6857 · changes requested · 5 findings · 38 min

Run code-review-agent_6b058dbc0b5838.96589553 · trail

Comment thread inc/abilities/appearance_update.php Resolved
Comment thread inc/core/admin.php Resolved
Comment thread globals/sanitize-functions.php Resolved
Comment thread globals/sanitize-functions.php Resolved

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes requested

The four earlier findings in threads are fixed, but child-theme migration now blanks the search button mode, and stored colors still print unchecked.

  • inc/core/styles/css_prop.php:240-246 — correctness Colors stored before this fix still print without the color check in three more places. The box-shadow filter returns at inc/core/styles/css_prop.php:74-80, before this check. So a stored shadowColor of rgba(0,0,0,.5);}body{display:none} prints in --primarybtnshadow and closes the rule (inc/core/styles/css_vars.php:85-144, header-footer-grid/Core/Components/Button.php:259-285). Elementor global colors print stored palette colors unchanged (inc/compatibility/elementor.php:115-131,380-391). The palette switch prints its palettes unchanged (header-footer-grid/Core/Components/PaletteSwitch.php:202-221,239-246,284-300). Sanitize the color where these values are read, or in one shared reader. Add a test that stores a bad color for each printer.
Validation details
  • Files reviewed: 8/8 files changed since the prior review. The "Failure direction" rows (Causes, Too permissive, Too strict, Direction, Persistence, Recovery, Visibility) stay unchecked.
  • The three color test files pass in a copy of HEAD: cd /tmp/opencode/c6/repo; set -o pipefail; for pair in "sanitization:TestSanitization" "ability-color-inputs:TestNeveAbi… printed OK (16 tests, 176 assertions) (run R6)
  • Child-theme migration blanks header_search_button_appearance: cd /workspace/checks/C7/probe && python3 - <<'EOF' p='C7ProbeTest.php' s=open(p).read() s=s.replace(" add_filter( 'styl… (run R12, exit 0)
  • A stored shadow color prints with the extra CSS: cd /workspace/checks/C7/probe && python3 - <<'EOF' p='C7ProbeTest.php' s=open(p).read() s=s.replace(" public function te… (run R10, exit 0)
Untested areas
  • The "Failure direction" rows for the button background fallback were not rechecked.
  • The Elementor and palette switch printers were traced in source only.
  • Beaver Builder palette presets were not read past normalization.
  • Imported palette slugs with uppercase letters would be dropped. No such import was found.
  • The suite does not load in /repo. A copy passes.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • inc/compatibility/beaver.php:138-176 — unverified: Stored malformed colors reach Beaver presets unchanged. Beaver Builder Lite 2.11.2.2 (/deps/plugins/beaver-builder-lite-version/latest/fl-builder.php:6) normalizes filtered presets…

🤖 Automated review · run code-review-agent_6b066ea7a5b743.08935689.


🤖 Review agent — review posted ✅ on e73fc8ef · changes requested · 3 findings · 25 min

Run code-review-agent_6b066ea7a5b743.08935689 · trail

Comment thread inc/core/admin.php Resolved
Comment thread globals/sanitize-functions.php Resolved

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

This approves the PR because the earlier findings are fixed; the note asks a developer to confirm that no importer writes unsafe custom color keys.

  • inc/core/front_end.php:625 — note css_global_custom_colors() prints each stored neve_global_custom_colors key raw into selectors and var(--…). A stored key such as custom-1);color:red}body{display:none}/* closes the rule in the generated CSS. The Customizer drops such keys, and the :root printer now drops them too. Can any importer or migration still write custom color keys without sanitize_global_custom_colors()? If none can, this is safe. If one can, filter the keys here as well.
Validation details
  • Files reviewed: 11/11 files changed since the prior review. The rows "Button::add_style() return changed" and "neve_sanitize_button_appearance() return changed" stay unchecked.
  • The three changed test classes pass at HEAD in a copy of the theme: cd /tmp/opencode/c1/repo && set -o pipefail; for c in TestSanitization TestNeveCssStyleTags TestElementorCompatibility; … printed OK (16 tests, 180 assertions) (run R3)
  • With the non-test files from e73fc8e, the new assertions fail for the gradient suffix, the search button mode, the shadow, the palette switch and Elementor: cd /tmp/opencode/c1/prior/repo && set -o pipefail; for c in TestSanitization TestNeveCssStyleTags TestElementorCompatibi… printed Tests: 16, Assertions: 170, Failures: 2. (run R4)
  • A stored unsafe custom color key still prints raw in the front-end CSS: set -o pipefail; cd /tmp/opencode/c1/repo && ls -la /workspace/checks/C9/ && timeout 300 phpunit --do-not-cache-result -… printed HAS_display_none_in_FRAG: yes (run R6)
Untested areas
  • The rows "Button::add_style() return changed" and "neve_sanitize_button_appearance() return changed" were not settled.
  • Beaver Builder palette presets were not traced to their CSS output.
  • No importer that writes custom color keys directly was found or ruled out.
  • The Customizer button presets and preview scripts were not traced.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • inc/compatibility/beaver.php:138-176 — unverified: Both palette sources still return unchecked presets. Beaver Builder Lite 2.11.2.2 (/deps/plugins/beaver-builder-lite-version/latest/fl-builder.php:6) normalizes after this filter (…
    • not reached: Customizer-preview producer validation before assets/js/src/customizer-preview/css-var-handler.js:118-146,307-350,440-449

🤖 Automated review · run code-review-agent_6b06779a4f1e05.30507687.


🤖 Review agent — review posted ✅ on d6a4bd0b · approved · 0 findings · 34 min

Run code-review-agent_6b06779a4f1e05.30507687 · trail

@vytisbulkevicius

Copy link
Copy Markdown
Contributor

@girishpanchal30 #4718 now conflicts with development, after #4710 was merged today. Both PRs change the same ability sanitization in different ways, so it needs your call. development is also red on test_sanitize_colors_rejects_incomplete_rgba, which this PR fixes. That keeps #4715 and #4717 red too.

I tried merging development into this branch and ran the full PHPUnit suite:

Resolution Fails
development wins the conflicts 5 tests in test-neve-ability-color-inputs.php (this PR's stricter rejection of malformed colors, backgrounds and button appearances)
This PR wins the conflicts 3 #4710 tests: test_button_appearance_setting_keeps_only_valid_values (dimension sanitization), test_set_theme_mod_ability_rejects_values_that_close_css (the ;} guard on padding, radius, spacing and sidebar width), test_configure_abilities_sanitize_row_style_colors

Most of it combines cleanly: keep this PR's color, background and button-appearance checks, and add #4710's dimension loop in neve_sanitize_button_appearance() and its CSS-closing guard (sanitize_style_mod() / closes_css_declaration() with TEXT_KEYS) for the other keys. The RGBA fix (neve_get_css_function_color_args()) doesn't conflict.

One behaviour contradicts. When an ability sends a background with one malformed color:

  • this PR (test_header_row_style_skips_malformed_colors, test_set_theme_mod_rejects_background_with_malformed_color) rejects the whole background and returns a warning or invalid_value;
  • Validated header and footer row text colors #4710 (test_configure_abilities_sanitize_row_style_colors) saves the background with that color blanked to ''.

Which one do you want? Also note that apply_row_style() has a different signature on each side, ($builder_id, $row, $style, &$warnings) vs (Abstract_Builder $builder, $row, $style).

@girishpanchal30
girishpanchal30 force-pushed the bugfix/rgba-function-color-structure branch from d6a4bd0 to 57c4383 Compare November 26, 2026 05:52

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes requested

Switching to a child theme now drops the palette switch auto-adjust setting. Fix the migration check before merge.

Questions for the author

  • Is any non-array value other than a JSON object string a supported button appearance? neve_sanitize_button_appearance() now returns '' for it.
Validation details
  • Files reviewed: 15/15 changed files. Six history and checklist questions stayed unchecked; they are named under Untested areas.
  • The migration skip ran in isolation on PHP 8.3: sed -n '1,175p' /repo/globals/sanitize-functions.php > /workspace/checks/C14/sanitize-functions.php { printf '<?php\n'; … printed toggle skipped: yes (run R1)
Untested areas
  • These questions were not settled: "Button border radius removal (#3565)", "Add to cart button regression (#3570)", "Elementor global colors consistency (#4633)", "Stricter gradient validator blanking values", "Color check on stored CSS variables", "Failure direction: Causes".
  • The Customizer preview prints stored palette colors raw. A visible effect was not shown.
  • Beaver Builder palette presets and Neve Pro mods were not traced.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • assets/js/src/customizer-preview/css-var-handler.js:118-146,307-350,440-449 — unverified: Background, overlay and both shadow colors are interpolated without validation; sibling direct-color and button handlers also interpolate values at assets/js/src/customizer-preview…
    • inc/compatibility/beaver.php:138-176 — unverified: Registered at lines 25-27, this exports stored palette colors and custom val fields after only removing #. Beaver Builder Lite 2.11.2.2 (/deps/plugins/beaver-builder-lite-version/l…

🤖 Automated review · run code-review-agent_6b07c956330ba5.88243567.


🤖 Review agent — review posted ✅ on 57c43835 · changes requested · 1 finding · 40 min

Run code-review-agent_6b07c956330ba5.88243567 · trail

Comment thread inc/core/admin.php Resolved

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

This approves the PR because the child-theme migration now keeps the palette switch toggle, and the earlier findings are fixed.

Validation details
  • Files reviewed: 15/15 changed files. Five questions stayed unchecked: "neve_sanitize_button_appearance() return changed", "Add to cart button regression (#3570)", "Array to string conversion warning (#3406)", "Failure direction: Causes" and "Failure direction: Too strict".
  • The migration test passes at this commit: cd /repo && set -o pipefail; timeout 290 php /workspace/checks/C2/run-one.php 2>&1 | tee /workspace/checks/C2/run-one.lo… printed RESULT run=1 failures=0 errors=0 risky=0 skipped=0 (run R17)
  • With the old migration code, the same test fails: cd /repo && git show 57c438357f0411f2a679f9802e694e46985ba8b9:inc/core/admin.php > /workspace/checks/C2/themes/neve/inc/… printed Failed asserting that false is identical to 1. (run R19)
  • The sanitization test class passes: `cd /repo && cat > /workspace/checks/C2/run-class.php <<'EOF'
Untested areas - The five questions named above were not settled. - Customizer preview color handlers and the Beaver Builder palette export were not traced to a visible effect. - No producer of palette colors with surrounding spaces was found. An import that stores one would lose that color. - The repository-wide PHPUnit run fails to load in the sandbox. A custom entry script ran the class instead. - The variant pass did not settle these places, where the fixed cause may still reach: - `assets/js/src/customizer-preview/app.js:378-443` — unverified: preview handlers interpolate background, overlay, button and shadow colors into style.innerHTML without equivalent validation. The decisive remaining fact is whether an ordinary co… - `assets/js/src/customizer-preview/css-var-handler.js:117-146,294-350,364-369,440-449` — unverified: preview handlers interpolate background, overlay, button and shadow colors into style.innerHTML without equivalent validation. The decisive remaining fact is whether an ordinary co… - `inc/compatibility/beaver.php:138-176` — unverified: stored palette and custom colors leave Neve unchecked. Beaver Builder Lite 2.11.2.2 preserves non-hex presets (/deps/plugins/beaver-builder-lite-version/latest/classes/class-fl-bui…
🤖 Automated review · run code-review-agent_6b07d5de64fc42.63338681. --- **🤖 Review agent** — review posted ✅ on `b0b000c9` · [approved · 0 findings](https://github.com//pull/4718#pullrequestreview-6069865796) · 23 min Run `code-review-agent_6b07d5de64fc42.63338681` · [trail](https://agents.vertistudio.com/admin/trails/github-pr/Codeinwp-neve-4718)

@girishpanchal30

Copy link
Copy Markdown
Contributor Author

@vytisbulkevicius I have resolved the conflict. I rebased the branch onto development (after #4710) and combined the two the way you suggested:

  • Color, background and button-appearance checks: this PR's stricter helpers (sanitize_color_input(), sanitize_background_input(), sanitize_button_appearance_input()) now run through Validated header and footer row text colors #4710's sanitize_style_mod(), so there's one entry point for every ability route.
  • Validated header and footer row text colors #4710's CSS-closing guard: closes_css_declaration() with TEXT_KEYS still covers all other keys (padding, radius, spacing, sidebar width). Button appearances now go through it as well, after the button sanitizer.
  • Validated header and footer row text colors #4710's dimension loop in neve_sanitize_button_appearance() is kept.
  • apply_row_style(): I kept development's signature, (Abstract_Builder $builder, $row, $style) returning the warnings, and dropped this PR's &$warnings version. The header and footer callers are unchanged from development.

On the behaviour conflict, I went with this PR's behaviour: when an ability sends a background with a malformed color, the whole background is rejected. row_style returns an Invalid value for "row_style.<row>.background" warning, and set_theme_mod returns invalid_value. Nothing is saved. This keeps the two routes consistent, and the caller is told the value was refused instead of having a color silently blanked to ''. I updated #4710's test_configure_abilities_sanitize_row_style_colors to assert that behaviour: the background is not saved and the warning is returned.

@vytisbulkevicius
vytisbulkevicius merged commit 4dc2fb9 into development Nov 26, 2026
18 checks passed
@vytisbulkevicius
vytisbulkevicius deleted the bugfix/rgba-function-color-structure branch November 26, 2026 07:31
@pirate-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 4.2.20 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has conflicts released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants