Skip to content

Normalize frontpage directory parameters before rendering the bundled theme - #169

Open
snoopdave wants to merge 1 commit into
masterfrom
frontpage-directory-rendering
Open

Normalize frontpage directory parameters before rendering the bundled theme#169
snoopdave wants to merge 1 commit into
masterfrom
frontpage-directory-rendering

Conversation

@snoopdave

Copy link
Copy Markdown
Contributor

The bundled frontpage theme's blog-directory page filters its listing by a
letter request parameter and builds a back-link from a weblog parameter.
This change validates and normalizes both before use and escapes them at output.

What changed

  • Accept a single ASCII letter, normalize lowercase to uppercase, and require it
    to be a key in the business layer's weblog-letter map.
  • Fall back to the full directory ("All weblogs") for missing or invalid input,
    without redirecting, erroring, or echoing the rejected value.
  • Escape the accepted value at HTML output even after validation.
  • Resolve the weblog parameter to an existing weblog and build the back-link
    from the resolved handle, escaped at output.

Tests

  • Missing input renders "All weblogs"; uppercase and lowercase valid keys select
    the same group.
  • Multi-character, numeric, punctuation, and non-ASCII values fall back to the
    full listing and do not appear in the response, raw or encoded.
  • Paging retains only the normalized, validated key.
  • Strengthened business-map test asserts the exact A–Z key set.

… theme

The bundled frontpage directory filters its listing by a letter parameter. It
now accepts that parameter only when it matches one of the directory's own A-Z
keys, falling back to the full listing otherwise (as a missing parameter already
did), and HTML-escapes it in the heading.

The sibling directory template resolves its weblog handle before use and builds
the back-link from the resolved weblog rather than the request parameter.

Adds FrontpageDirectoryRenderingTest and tightens the weblog letter-map test to
assert the complete A-Z key set the template now depends on.

Claude-Session: https://claude.ai/code/session_01A1fhY1E2PCFU6UAPXu2WtV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant