From b2012947ac10790c534ede1668797e176710be80 Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Fri, 27 Dec 2024 17:37:29 +0100 Subject: [PATCH 1/2] Repair schema.org context. Fixes #14630 --- src/Util/JsonLD.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Util/JsonLD.php b/src/Util/JsonLD.php index 74f6e4baca..df320b4bf4 100644 --- a/src/Util/JsonLD.php +++ b/src/Util/JsonLD.php @@ -227,6 +227,11 @@ class JsonLD Logger::debug('schema.org path fixed'); $value = 'http://schema.org#'; } + // Issue 14630: Wordpress Event Bridge uses a URL that cannot be retrieved + if ($value == 'https://schema.org/') { + Logger::debug('https schema.org path fixed'); + $value = 'https://schema.org/docs/jsonldcontext.json#'; + } }); // Bookwyrm transmits "id" fields with "null", which isn't allowed. From ba26e9c06d842b7388c1edf4eed5e644079455c6 Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Fri, 27 Dec 2024 21:28:11 +0100 Subject: [PATCH 2/2] Only replace schema.org if it is a top-level context --- src/Util/JsonLD.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util/JsonLD.php b/src/Util/JsonLD.php index df320b4bf4..25131a080f 100644 --- a/src/Util/JsonLD.php +++ b/src/Util/JsonLD.php @@ -228,7 +228,7 @@ class JsonLD $value = 'http://schema.org#'; } // Issue 14630: Wordpress Event Bridge uses a URL that cannot be retrieved - if ($value == 'https://schema.org/') { + if (is_int($key) && $value == 'https://schema.org/') { Logger::debug('https schema.org path fixed'); $value = 'https://schema.org/docs/jsonldcontext.json#'; }