- Joined
- Mar 11, 2025
- Messages
- 1
- Reaction score
- 0
Hello Xen-Soluce team,
I run ExcelMale.com on XenForo 2.3 with [Xen-Soluce] SEO Optimization 3.0.0 Fix 1. Thread meta descriptions are being HTML-escaped twice, so search results show raw entities.
Example: a custom meta description of "based on Nelson Vergel's method" was output as:
Google then displays "Vergel's". The same happens with " for double quotes, and it affects both custom descriptions and descriptions generated from the first post. It applies to description, og:description and twitter:description. Meta titles are not affected.
Cause, as far as I can trace it:
Workaround I applied in a custom template modification that runs after yours:
Suggested permanent fix: have change_description() return plain text for the thread_view path (or decode it before it reaches $fpSnippet), so metadata_macros escapes it only once.
I'm happy to provide more details or test a patch.
Thank you,
Nelson Vergel
ExcelMale.com
I run ExcelMale.com on XenForo 2.3 with [Xen-Soluce] SEO Optimization 3.0.0 Fix 1. Thread meta descriptions are being HTML-escaped twice, so search results show raw entities.
Example: a custom meta description of "based on Nelson Vergel's method" was output as:
Code:
<meta name="description" content="...Nelson Vergel&#039;s method.">
Cause, as far as I can trace it:
- Template modification xs_seo "Threads : Meta-Description" on thread_view replaces the $fpSnippet line with:
Code:<xf:set var="$fpSnippet" value="{{ change_description($thread)|raw }}" /> - change_description() returns text that is already HTML-escaped (' becomes ', " becomes "
. - XenForo's core metadata_macros::description then outputs snippet($description|strip_tags, 160)|for_attr, which escapes the & a second time.
Workaround I applied in a custom template modification that runs after yours:
Code:
<xf:set var="$fpSnippet">{{ $fpSnippet|replace({''': "'", '"': '"', '&': '&'})|raw }}</xf:set>
I'm happy to provide more details or test a patch.
Thank you,
Nelson Vergel
ExcelMale.com