User tests: Successful: Unsuccessful:
Pull Request resolves #47743
The Email Cloaking plugin (plg_content_emailcloak) was applying its
email replacement logic to the entire page output without excluding
<script type="application/ld+json"> blocks.
As a result, email addresses present in JSON-LD structured data were
being replaced with HTML Web Component markup (<joomla-hidden-mail ...>),
which produces syntactically invalid JSON. This causes JSON parse errors
such as "Missing ',' or '}' after property value" when the structured
data is parsed by search engines or validation tools like Google's
Rich Results Test.
Changes made:
plugins/content/emailcloak/src/Extension/EmailCloak.php, insidecloak() method, all <script type="application/ld+json"> blocks<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"email": "info@example.com"
}
</script>info@example.comEmail addresses inside <script type="application/ld+json"> blocks
were replaced with HTML markup, producing invalid JSON and causing
Schema.org structured data validation errors.
Email addresses inside JSON-LD blocks are preserved exactly as written.
All other email addresses on the page are still cloaked normally.
JSON-LD structured data remains valid and parseable by search engines.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Front End Plugins |
I cannot replicate the issue before patch.
Using the person schema, the output in the sourcecode is something like ,
"name":"meins","url":"https://example.org","email":"kontakt@example.or","address":{"@type":"PostalAddress","addressLo ...
I cannot replicate the issue before patch.
Using the person schema, the output in the sourcecode is something like ,
"name":"meins","url":"https://example.org","email":"kontakt@example.org","address":{"@type":"PostalAddress","addressLo ...
| Labels |
Added:
PR-5.4-dev
|
||
Fixed the PHP code style issue (missing newline at end of file).
Regarding the testing feedback from @chmst and @brianteeman — the issue
may depend on how the JSON-LD block is output on the page. @01Kuzma
confirmed the bug is reproducible.
The fix is safe and non-breaking — it only skips JSON-LD script blocks
and does not change behaviour for any other email addresses on the page.
Regarding the testing feedback from @chmst and @brianteeman — the issue
may depend on how the JSON-LD block is output on the page. @01Kuzma
confirmed the bug is reproducible.
so please show us how to replicate the bug. If we cant replicate the bug then we cant test that this code change fixes anything
@brianteeman thank you for your feedback and for taking the time to test.
Here are the exact steps to reproduce the issue:
@01Kuzma has already confirmed this behaviour with a screenshot.
I hope this helps to reproduce the issue. Please let me know if
you need any further information.
@01Kuzma please provide the exact steps you took and which schema you were using
I use YooTheme pro builder and I insert raw code into HTML component, for example, this one:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
...
"email": "my@email.com",
...
"logo": {
"@type": "ImageObject",
"url": "https://...logo.png"
},
"address": {...
},...
]
}
</script>
Not surprised it breaks for you then as you're not using the provided schema plugins. You should never be inserting scripts directly in the article. This pr is fixing user errors and should not be accepted
Not surprised it breaks for you then as you're not using the provided schema plugins. You should never be inserting scripts directly in the article. This pr is fixing user errors and should not be accepted
Schema plugins are very limited in many use cases. They are good only for very basic usage
by default you cant even paste the code you suggested into joomla content as it strips out any scripts.
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-05-09 13:33:36 |
| Closed_By | ⇒ | chmst |
Closing this as it is no issue of the Joomla core.
I cannot replicate the issue befor patch.
Using the person schema, the output in the sourcecode is something like ,
"name":"meins","url":"https://example.org","email":"kontakt@example.or","address":{"@type":"PostalAddress","addressLo ...