From 3153f4d30a2554e49e359003c6148d0641daf341 Mon Sep 17 00:00:00 2001 From: Niklas Forsdahl Date: Wed, 5 May 2021 12:54:23 +0300 Subject: [PATCH] Sanitize classname for has_one relations Sanitize the classname for has_one relations in XMLDataFormatter, to not break the XML and make the relation link work. --- src/DataFormatter/XMLDataFormatter.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DataFormatter/XMLDataFormatter.php b/src/DataFormatter/XMLDataFormatter.php index 8908ff9..54873fc 100644 --- a/src/DataFormatter/XMLDataFormatter.php +++ b/src/DataFormatter/XMLDataFormatter.php @@ -148,6 +148,8 @@ class XMLDataFormatter extends DataFormatter if (!singleton($relClass)->stat('api_access')) { continue; } + // backslashes in FQCNs kills both URIs and XML + $relClass = $this->sanitiseClassName($relClass); // Field filtering if ($fields && !in_array($relName, $fields)) {