Bug: Evergreen search uses fragile JSON LIKE query #101

Open
opened 2026-05-29 05:30:33 +00:00 by jmiller · 1 comment
Owner

Audit Finding M-2

Severity: Medium

Issue:
processEvergreen() finds evergreen articles using attribs LIKE '%mokojoomcross_evergreen":"1"%'. This is fragile — it could match false positives if the string appears in article content, and breaks if JSON key ordering changes.

Fix: Use MySQL JSON_EXTRACT() function: JSON_EXTRACT(attribs, '$.mokojoomcross_evergreen') = '1'.

Files: QueueProcessor.php

Label: priority: medium, type: bug

## Audit Finding M-2 **Severity:** Medium **Issue:** `processEvergreen()` finds evergreen articles using `attribs LIKE '%mokojoomcross_evergreen":"1"%'`. This is fragile — it could match false positives if the string appears in article content, and breaks if JSON key ordering changes. **Fix:** Use MySQL `JSON_EXTRACT()` function: `JSON_EXTRACT(attribs, '$.mokojoomcross_evergreen') = '1'`. **Files:** `QueueProcessor.php` **Label:** `priority: medium`, `type: bug`
Author
Owner

Branch created: feature/101-bug-evergreen-search-uses-fragile-json-l

git fetch origin
git checkout feature/101-bug-evergreen-search-uses-fragile-json-l
Branch created: [`feature/101-bug-evergreen-search-uses-fragile-json-l`](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomCross/src/branch/feature/101-bug-evergreen-search-uses-fragile-json-l) ```bash git fetch origin git checkout feature/101-bug-evergreen-search-uses-fragile-json-l ```
Sign in to join this conversation.
Type Bug
Status
Priority
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomCross#101