Skip to content
Snippets Groups Projects
Commit 0239bad8 authored by Ilias Dimopoulos's avatar Ilias Dimopoulos Committed by Claudiu Cristea
Browse files

ISAICP-9526: Clean up the code a bit. We no longer have /rdf_entity/, there is...

ISAICP-9526: Clean up the code a bit. We no longer have /rdf_entity/, there is no point to encode right before decode. Allow / in the suffix.
parent bde32f03
No related branches found
No related tags found
1 merge request!211Release 2.2.2
......@@ -77,7 +77,6 @@ public static function getEntityTypeFromPersistentUriNamespace(?string $namespac
$namespaces = [
'w21' => 'node',
'dr8' => 'taxonomy_term',
'dr8/egovera' => 'taxonomy_term',
];
if (!$namespace) {
......
......@@ -61,16 +61,11 @@ public function on404(ExceptionEvent $event): void {
*/
public function getTargetEntity(string $path): array {
// Extracts the encoded URI and everything that comes after.
$pattern = '@^(?<prefix>/rdf_entity/|/taxonomy/term/)(?<uri>http_e_f_f[^?]*)(?<suffix>/(?:.*))?$@';
$pattern = '@^(?<prefix>/taxonomy/term/)(?<uri>http_e_f_f[^?]*)(?<suffix>/(?:.*))?$@';
if (!preg_match($pattern, $path, $found)) {
return [NULL, NULL];
}
// Cases like eGovEra are redirected with a / in their URI. We need to fix
// this by replacing the prefix.
if ($found['uri'] && str_contains($found['uri'], '_fegovera/')) {
$found['uri'] = str_replace('/', '_f', $found['uri']);
}
if (!$entity = $this->getEntity($found['uri'])) {
return [NULL, NULL];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment