fix: full-form internal links follow the {{link:}} target rules (ruling P10)

One PostIdParser for {{link:}} and select_post; post_link_url_<type> needs a
living, readable, non-attachment target of exactly that type.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 14:54:51 +02:00
co-authored by Claude Opus 5.5
parent c615522cf6
commit 06f13799de
14 changed files with 229 additions and 28 deletions
@@ -205,12 +205,12 @@ final class DiviDynamicSourcesAbility implements Ability
return '{{post:' . $post . '}}';
}
if (! str_starts_with($name, 'post_link_url_')) {
if (! str_starts_with($name, DynamicContentRules::LINK_PREFIX)) {
return null;
}
// Review M-9: {{link:}} refuses attachments (status inherit); internal types ("_…") are no link targets.
$type = substr($name, strlen('post_link_url_'));
// Review M-9/P10: {{link:}} and the full form refuse attachments; internal types ("_…") are no link targets.
$type = substr($name, strlen(DynamicContentRules::LINK_PREFIX));
return $type === 'attachment' || str_starts_with($type, '_') ? null : '{{link:<ID>}}';
}