Fix review findings: canonical URL normalization, JSON-LD escaping, ARIA state, CI coverage - #5
Conversation
… coverage - Normalize the canonical path by stripping a trailing /index.php so directory and index.php URLs for the same page (docs, legal) emit an identical canonical link. - Add JSON_HEX_* flags to the JSON-LD json_encode call so structured data can never break out of the surrounding <script> tag. - Sync the nav toggle's aria-expanded attribute with its open/closed state in main.js instead of only toggling a CSS class. - Add /legal/ to the CI smoke-test route list so it matches sitemap.xml coverage. Addresses the SonarCloud quality gate failures (Security/Reliability ratings on new code) flagged on this PR.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
PR Summary by QodoFix canonical URL normalization, JSON-LD escaping, ARIA state, and CI route coverage
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
|



What changed
Addresses the four review findings (qodo-code-review) posted on #2, which also line up with the SonarCloud quality gate failure on that PR (Reliability B, Security C on new code):
$canonicalPathby stripping a trailing/index.php, so pages that don't set$canonicalPathexplicitly (docs, legal) emit the same canonical URL whether reached via the directory path or theindex.phppath.JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOTto the JSON-LDjson_encode()call so structured data can't break out of the<script type="application/ld+json">tag.aria-expandedattribute with the actual open/closed state instead of only toggling a CSS class./legal/to the CI smoke-test route list — it's listed insitemap.xmlbut wasn't being checked.Validation
php -lon the changed PHP file: no syntax errors.php -Sand curled/,/quickstart/,/docs/,/legal/,/guides/: all return 200.<link rel="canonical">and JSON-LD<script>render correctly after the change.Base branch is
agent/reach-and-seo(the existing open PR #2) so this merges into that PR rather than opening a separate, conflicting change againstmain.Generated by Claude Code
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.