Fatal frontend 500: scalar custom JSON-LD value crashes page render #97
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem (BLOCKING)
A scalar value saved into a record's
custom_schemafield white-screens the public frontend with a PHP 8 fatal error.Root cause — two gaps
MokoOGContent::validateJson()(plg_content_mokoog/src/Extension/MokoOGContent.php:321-330) only rejects empty/invalid JSON:42,"x", ortruedecodes to a non-null scalar, so it passes validation and is stored.MokoOG.php:359-363:$decoded['@context']when$decodedis an int/float/bool/null throwsError: Cannot use a scalar value as an array→ unhandled 500 on every public page rendering that content.Fix
validateJson(): require an object/array — reject unlessis_array(json_decode($json, true)).MokoOG.php: guard the render path withif (is_array($decoded))before mutating.Severity
Release blocker — attacker/editor-supplied (or fat-fingered) input takes down the public site.
Branch created:
feature/97-fatal-frontend-500-scalar-custom-json-ld