Skip to content

Conversation

@nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Jan 16, 2026

This pull request updates the Open Graph preview and text count components to improve user experience and maintain consistency across legacy and new edit modes. It introduces a new text counter for the old editor, ensures fallback images for OG previews, and applies minor style enhancements.

Text Counter Improvements:

  • Added a new version of the text counter for the old editor, with improved layout, live character counting, and color feedback when exceeding the recommended maximum (text-count_old.vtl).
  • Updated the main text count template to conditionally load either the new or old version based on the edit mode, ensuring compatibility and consistent behavior (text_count.vtl).

Open Graph Preview Enhancements:

  • Changed the OG image preview logic to display a placeholder image if no image is set, improving the visual feedback for users (og_preview_new.vtl).
  • Added a text color style to the OG preview description for better readability in the old preview template (og_preview_old.vtl).

This PR fixes: #34029

This PR fixes: #34029

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances the Open Graph preview and text count components for dotCMS's content editor by introducing a new text counter for the legacy editor and improving the OG preview fallback behavior.

Changes:

  • Added a routing template (text_count.vtl) that conditionally loads either the new or old text counter based on edit mode
  • Created new text counter implementations for both new (text_count_new.vtl) and legacy (text-count_old.vtl) editors with live character counting and color feedback
  • Updated OG preview to show a placeholder image when no image is set (og_preview_new.vtl)
  • Added text color styling to the OG preview for better readability (og_preview_old.vtl)

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
text_count.vtl Router template that conditionally includes the appropriate text counter based on edit mode
text_count_new.vtl New text counter implementation using modern DotCustomFieldApi with module script
text-count_old.vtl Legacy text counter implementation using legacy DotCustomFieldApi methods
og_preview_new.vtl Updated to use external placeholder image when no OG image is set
og_preview_old.vtl Added color styling to the preview host element

erickgonzalez and others added 3 commits January 20, 2026 09:37
@semgrep-code-dotcms-test
Copy link

Semgrep found 6 ssc-4fd3a3fc-acff-4277-9d88-60469f5a4fa5 findings:

  • core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/dot-analytics-dashboard.component.ts
  • core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/components/dot-analytics-sparkline/dot-analytics-sparkline.component.ts
  • core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/components/dot-analytics-platforms-table/dot-analytics-platforms-table.component.ts
  • core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/components/dot-analytics-dashboard-metrics/dot-analytics-dashboard-metrics.component.ts
  • core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/components/dot-analytics-dashboard-metrics/dot-analytics-dashboard-metrics.component.spec.ts
  • core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/components/dot-analytics-dashboard-engagement-report/dot-analytics-dashboard-engagement-report.component.ts

Risk: Affected versions of @angular/compiler and @angular/core are vulnerable to Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). Angular's template compiler fails to classify the href and xlink:href attributes on SVG <script> elements as Resource URL contexts. This allows an attacker to bind a malicious data: URI or external script via [attr.href] or [attr.xlink:href], resulting in arbitrary JavaScript execution (XSS) in the victim's browser.

Fix: Upgrade this library to at least version 20.3.16 at core/core-web/yarn.lock:512.

Reference(s): GHSA-jrmj-c5cx-3cw6, CVE-2026-22610

If this is a critical or high severity finding, please also link this issue in the #security channel in Slack.

@erickgonzalez erickgonzalez added this pull request to the merge queue Jan 22, 2026
Merged via the queue into main with commit 0a7a7fc Jan 22, 2026
38 checks passed
@erickgonzalez erickgonzalez deleted the 34029-vtl-errors branch January 22, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[TASK] Migrate "Pages" VTLs to new API

5 participants