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

ISAICP-9526: The suffix of a URI should be after a ?, not a /. There are IRIs...

ISAICP-9526: The suffix of a URI should be after a ?, not a /. There are IRIs that have the / as a separator.
parent 744e09a3
No related branches found
No related tags found
1 merge request!211Release 2.2.2
......@@ -61,11 +61,16 @@ 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>/rdf_entity/|/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