TagTable::check() does not validate field values #43

Open
opened 2026-05-31 01:19:00 +00:00 by jmiller · 1 comment
Owner

Problem

TagTable::check() only validates that content_type and content_id are non-empty. It does not:

  1. Validate og_type against allowed values (article, website, product, etc.)
  2. Enforce max length on og_title (255), seo_title (70), meta_description (200)
  3. Validate canonical_url format
  4. Validate robots contains only valid directives
  5. Sanitize content_type against allowed patterns

Impact

Invalid data stored in DB and output as meta tags. Social platform crawlers may reject pages or produce malformed HTML.

Acceptance Criteria

  • Validate og_type against enum of valid OG types
  • Truncate/validate string fields to schema max lengths
  • Validate canonical_url format if non-empty
  • Validate robots directives if non-empty
  • Validate content_type matches pattern [a-z_.]+

File

  • src/packages/com_mokoog/src/Table/TagTable.php:35-49
## Problem `TagTable::check()` only validates that `content_type` and `content_id` are non-empty. It does not: 1. Validate `og_type` against allowed values (article, website, product, etc.) 2. Enforce max length on `og_title` (255), `seo_title` (70), `meta_description` (200) 3. Validate `canonical_url` format 4. Validate `robots` contains only valid directives 5. Sanitize `content_type` against allowed patterns ## Impact Invalid data stored in DB and output as meta tags. Social platform crawlers may reject pages or produce malformed HTML. ## Acceptance Criteria - [ ] Validate `og_type` against enum of valid OG types - [ ] Truncate/validate string fields to schema max lengths - [ ] Validate `canonical_url` format if non-empty - [ ] Validate `robots` directives if non-empty - [ ] Validate `content_type` matches pattern `[a-z_.]+` ## File - `src/packages/com_mokoog/src/Table/TagTable.php:35-49`
jmiller added the enhancementpriority: mediumproduction-readiness labels 2026-05-31 01:19:00 +00:00
Author
Owner

Branch created: feature/43-tagtable-check-does-not-validate-field-v

git fetch origin
git checkout feature/43-tagtable-check-does-not-validate-field-v
Branch created: [`feature/43-tagtable-check-does-not-validate-field-v`](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomOpenGraph/src/branch/feature/43-tagtable-check-does-not-validate-field-v) ```bash git fetch origin git checkout feature/43-tagtable-check-does-not-validate-field-v ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomOpenGraph#43