Skip to content
Snippets Groups Projects
Commit 48627dbe authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Remove overzealous encoding of error parameters

Output encoding happens in the view. This prevents the encoded stuff
from ending up in other places, including log files. Also fixes
tests that were broken because of this.
parent 8090587a
No related branches found
No related tags found
No related merge requests found
...@@ -43,8 +43,8 @@ class AuthSource extends Error ...@@ -43,8 +43,8 @@ class AuthSource extends Error
parent::__construct( parent::__construct(
[ [
'AUTHSOURCEERROR', 'AUTHSOURCEERROR',
'%AUTHSOURCE%' => htmlspecialchars(var_export($this->authsource, true)), '%AUTHSOURCE%' => $this->authsource,
'%REASON%' => htmlspecialchars(var_export($this->reason, true)) '%REASON%' => $this->reason
], ],
$cause $cause
); );
......
...@@ -24,7 +24,7 @@ class MetadataNotFound extends Error ...@@ -24,7 +24,7 @@ class MetadataNotFound extends Error
$this->includeTemplate = 'core:no_metadata.twig'; $this->includeTemplate = 'core:no_metadata.twig';
parent::__construct([ parent::__construct([
'METADATANOTFOUND', 'METADATANOTFOUND',
'%ENTITYID%' => htmlspecialchars(var_export($entityId, true)) '%ENTITYID%' => $entityId
]); ]);
} }
} }
...@@ -299,8 +299,7 @@ class ServiceProviderTest extends TestCase ...@@ -299,8 +299,7 @@ class ServiceProviderTest extends TestCase
$c = new Controller\ServiceProvider($this->config, $this->session); $c = new Controller\ServiceProvider($this->config, $this->session);
$this->expectException(Error\MetadataNotFound::class); $this->expectException(Error\MetadataNotFound::class);
// Breaks PHP 8.1 tests $this->expectExceptionMessage("METADATANOTFOUND('%ENTITYID%' => 'https://engine.test.surfconext.nl/authentication/idp/metadata')");
// $this->expectExceptionMessage("METADATANOTFOUND('%ENTITYID%' => '\'https://engine.test.surfconext.nl/authentication/idp/metadata\'')");
$c->assertionConsumerService('phpunit'); $c->assertionConsumerService('phpunit');
} }
...@@ -388,8 +387,7 @@ XML; ...@@ -388,8 +387,7 @@ XML;
$c = new Controller\ServiceProvider($this->config, $this->session); $c = new Controller\ServiceProvider($this->config, $this->session);
$this->expectException(Error\MetadataNotFound::class); $this->expectException(Error\MetadataNotFound::class);
// Breaks PHP 8.1 tests $this->expectExceptionMessage("METADATANOTFOUND('%ENTITYID%' => 'TheIssuer')");
// $this->expectExceptionMessage("METADATANOTFOUND('%ENTITYID%' => '\'https://engine.test.surfconext.nl/authentication/idp/metadata\'')");
$c->singleLogoutService('phpunit'); $c->singleLogoutService('phpunit');
} }
......
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