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.
This commit is contained in:
Niklas Forsdahl 2021-05-05 12:54:23 +03:00 committed by GitHub
parent 3da21bb6c2
commit 3153f4d30a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,6 +148,8 @@ class XMLDataFormatter extends DataFormatter
if (!singleton($relClass)->stat('api_access')) { if (!singleton($relClass)->stat('api_access')) {
continue; continue;
} }
// backslashes in FQCNs kills both URIs and XML
$relClass = $this->sanitiseClassName($relClass);
// Field filtering // Field filtering
if ($fields && !in_array($relName, $fields)) { if ($fields && !in_array($relName, $fields)) {