Skip to content

Sanitize the theme name to contain no path. - #1687

Merged
wengxt merged 1 commit into
masterfrom
theme_name
Sep 21, 2026
Merged

wengxt merged 1 commit into
masterfrom
theme_name

Conversation

@wengxt

@wengxt wengxt commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved theme name validation to reject invalid paths and names.
    • Prevented invalid theme settings from being loaded or saved.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: cecd6497-e5e5-4f57-b19f-7a0b2ea807eb

📥 Commits

Reviewing files that changed from the base of the PR and between 978bc64 and dc3542e.

📒 Files selected for processing (2)
  • src/ui/classic/classicui.cpp
  • src/ui/classic/classicui.h

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The classic UI now validates theme names as relative, single-component paths. Configuration reads and writes reject invalid extracted theme names before loading or saving.

Changes

Theme name validation

Layer / File(s) Summary
Define and apply the theme name constraint
src/ui/classic/classicui.h
ThemeNameConstrain replaces NotEmpty. It rejects empty names, non-relative paths, paths with parent components, and . or .. filenames. The theme and themeDark options use the new constraint.
Validate names during subconfig operations
src/ui/classic/classicui.cpp
getSubConfig and setSubConfig reject extracted theme names that fail ThemeNameConstrain before configuration loading or saving.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: validating theme names to prevent path components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@wengxt
wengxt merged commit bd8a1ab into master Sep 21, 2026
7 checks passed
@wengxt
wengxt deleted the theme_name branch September 21, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant