Open Graph: og:description truncation can split an HTML entity, producing "&#8217" in share previews
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
Direzione di ricerca
Trova il codice che tronca og:description di Jetpack a 197 caratteri ed esamina come gestisce le entità prodotte da wptexturize(). Inizia dal percorso di generazione del tag Open Graph e dai relativi test; aggiungi un caso di regressione in cui il troncamento cade all’interno di un’entità. Il lavoro è completato quando la meta description generata conserva l’apostrofo o la virgoletta e il test mirato passa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Impacted plugin
Jetpack
Quick summary
When Jetpack truncates og:description to 197 characters, the cut can land in the middle of an HTML
entity created by wptexturize() (e.g. "’" for an apostrophe). esc_attr() then escapes the broken
entity, so share previews show a literal "’" in the text.
Steps to reproduce
- On a site with Jetpack's Open Graph tags enabled, create a post with no manual excerpt.
- Write the opening paragraph so an apostrophe (or a curly quote or dash) falls right around the 197th
character, e.g. "...Most recently I've had all my domains through Namecheap. I've never used any of
Namecheap's other services, though..." - Publish the post and view the page source.
- Look at the og:description meta tag. It ends with "Namecheap’…" instead of "Namecheap’s…".
- Optionally, share the post URL on Mastodon, iMessage or Slack: the preview shows a literal "’"
in the text.
Mine is a live example: https://initialcharge.net/2026/11/namecheap-to-porkbun/
Site owner impact
Fewer than 20% of the total website/platform users
Severity
Minor
What other impact(s) does this issue have?
No revenue impact
If a workaround is available, please outline it here.
Two options:
-
Write a manual excerpt for the affected post. Make it short enough not to be truncated (under 197
characters), or check that no apostrophe, curly quote or dash sits at the cut point. -
Remove the partial entity with the jetpack_open_graph_tags filter, which runs after the truncation:
add_filter( 'jetpack_open_graph_tags', function ( $tags ) {
if ( ! empty( $tags['og:description'] ) ) {
// Drop a half-cut entity (e.g. "’") left right before the trailing ellipsis.
$tags['og:description'] = preg_replace( '/&#?[a-z0-9]*…$/i', '…',
$tags['og:description'] );
}
return $tags;
} );
Platform (Simple and/or Atomic)
Self-hosted
- Lingua principale
- PHP
- Stelle
- 1.9k
- Fork
- 913
- Merge medio
- 1g 18h
- PR unite (30g)
- 809
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Automattic/jetpack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Automattic/jetpack#55385 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
WAF: jetpack_waf_blocklog is created without the site's charset and collationForse già presa @jwebbdev l’ha presa 3 giorni fa. Aperta[Plugin] Protect Bug Customer Report
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
Automattic/jetpack#55365 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Package] Stats Admin [Type] Bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
Automattic/jetpack#54188 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Automattic/jetpack#53467 ·
I maintainer di solito rispondono entro 1 giorno
-
Brute_Force_Protection: two deprecated static wrappers throw Error on PHP 8 (self:: to non-static methods)Forse già presa @Valley-15 l’ha presa 85 giorni fa. ApertaBug Needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Automattic/jetpack#51728 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Automattic/jetpack
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/blocks-engine#7881 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
iruzen-dono/workless#117 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
magicsunday/webtrees-docker#285 ·
I maintainer di solito rispondono entro 1 giorno
-
Flaky browser test: AreaHeadersTest 'shows Counting on the way while deferred tab counts load'Apertaarea/tests type/bug when/soon
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbookForse già presa @mayankmajeji l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
WordPress/hosting-handbook#521 ·