KsesPolicy final readonly class
Minn\Support\KsesPolicy · public/minn/src/Minn/Support/KsesPolicy.php · 115 lines
What one kses pass allows: the tags, each tag's attributes (allowed plainly or with value rules), whether a tag takes data- attributes, which attributes hold URIs, and the schemes those URIs may use.
Constants and properties
| private | readonly array $tags | Promoted from the constructor. |
| private | readonly array $prefixes | Promoted from the constructor. |
| private | readonly array $uriAttributes | Promoted from the constructor. |
| prop | readonly array $schemes | Promoted from the constructor. |
Public
| new | __construct(array $tags, array $prefixes, array $uriAttributes, array $schemes)# |
| ||||||||||||
| static | post(): self# | Post content from an author without unfiltered_html: the reference's post allowlist as captured. | ||||||||||||
| static | comment(): self# | Comments, profiles and term descriptions: only the attributes each tag lists, nothing global. | ||||||||||||
| static | fromAllowlist(array $allowedHtml, array $schemes, array $uriAttributes): self# | A caller's own allowlist taken literally: a listed attribute is allowed whatever it maps to (false included, as the reference only asks whether the name is there), an array carries value rules, and "data-*" lets the tag take any data- name. Nothing else is implied.
| ||||||||||||
| method | allowsTag(string $tag): bool# | Whether the tag may appear at all. | ||||||||||||
| method | rules(string $tag, string $name): ?array# | The rules an attribute carries on a tag: an empty list when it is allowed plainly, null when it is not allowed. @return array<array-key, mixed>|null | ||||||||||||
| method | required(string $tag): array# | The attributes a tag must keep: lose one and the tag keeps none. @return list<string> | ||||||||||||
| method | holdsUri(string $name): bool# | Whether the attribute holds a URI whose scheme must be judged. |
Nothing matches.