Skip to content

#327 - ContextualOptionResolver: quote the context keys in the pattern of the placeholders - #328

Open
njoubert-cleverage wants to merge 1 commit into
mainfrom
327
Open

njoubert-cleverage wants to merge 1 commit into
mainfrom
327

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #327.

  • The context keys are quoted (preg_quote((string) $key, '/')) in the pattern of the {{ key }} placeholders: a key containing / made the pattern invalid (every string option of every task failed, even without placeholder), and a key containing a regex character matched other placeholders (x. matched {{ x }}).
  • With an empty context, the options are returned as is ({{ }} matched an empty key).
  • New ContextualOptionResolverTest (the class had no dedicated test).

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None: only keys containing regex characters change behaviour, they did not work.

🤖 Generated with Claude Code

…n of the placeholders, nothing to replace with an empty context

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

ContextualOptionResolver: the context keys are inserted unescaped in the regex

1 participant