Skip to content
Snippets Groups Projects
Unverified Commit e11c0eaf authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Merge pull request #1663 from simplesamlphp/fixup-error-encoding-zeal

Remove inappropriate output encoding
parents 8090587a a3779294
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
]); ]);
} }
} }
...@@ -100,7 +100,7 @@ class Attributes ...@@ -100,7 +100,7 @@ class Attributes
* *
* This function takes in a namespaced attribute name and splits it in a namespace/attribute name tuple. * This function takes in a namespaced attribute name and splits it in a namespace/attribute name tuple.
* When no namespace is found in the attribute name, it will be namespaced with the default namespace. * When no namespace is found in the attribute name, it will be namespaced with the default namespace.
* This default namespace can be overriden by supplying a second parameter to this function. * This default namespace can be overridden by supplying a second parameter to this function.
* *
* @param string $name The namespaced attribute name. * @param string $name The namespaced attribute name.
* @param string $defaultns The default namespace that should be used when no namespace is found. * @param string $defaultns The default namespace that should be used when no namespace is found.
...@@ -114,6 +114,6 @@ class Attributes ...@@ -114,6 +114,6 @@ class Attributes
$defaultns = substr($name, 0, $slash); $defaultns = substr($name, 0, $slash);
$name = substr($name, $slash + 1); $name = substr($name, $slash + 1);
} }
return [htmlspecialchars($defaultns), htmlspecialchars($name)]; return [$defaultns, $name];
} }
} }
...@@ -18,7 +18,6 @@ use function array_intersect; ...@@ -18,7 +18,6 @@ use function array_intersect;
use function array_key_exists; use function array_key_exists;
use function array_keys; use function array_keys;
use function array_merge; use function array_merge;
use function htmlspecialchars;
use function preg_match; use function preg_match;
use function sizeof; use function sizeof;
use function strcasecmp; use function strcasecmp;
...@@ -631,7 +630,7 @@ class IdPDisco ...@@ -631,7 +630,7 @@ class IdPDisco
$t->data['return'] = $this->returnURL; $t->data['return'] = $this->returnURL;
$t->data['returnIDParam'] = $this->returnIdParam; $t->data['returnIDParam'] = $this->returnIdParam;
$t->data['entityID'] = $this->spEntityId; $t->data['entityID'] = $this->spEntityId;
$t->data['urlpattern'] = htmlspecialchars($httpUtils->getSelfURLNoQuery()); $t->data['urlpattern'] = $httpUtils->getSelfURLNoQuery();
$t->data['rememberenabled'] = $this->config->getOptionalBoolean('idpdisco.enableremember', false); $t->data['rememberenabled'] = $this->config->getOptionalBoolean('idpdisco.enableremember', false);
$t->data['rememberchecked'] = $this->config->getOptionalBoolean('idpdisco.rememberchecked', false); $t->data['rememberchecked'] = $this->config->getOptionalBoolean('idpdisco.rememberchecked', false);
$t->send(); $t->send();
......
...@@ -39,7 +39,6 @@ use function count; ...@@ -39,7 +39,6 @@ use function count;
use function date; use function date;
use function explode; use function explode;
use function hash; use function hash;
use function htmlspecialchars;
use function in_array; use function in_array;
use function is_null; use function is_null;
use function key; use function key;
...@@ -476,10 +475,10 @@ class Template extends Response ...@@ -476,10 +475,10 @@ class Template extends Response
$url = false; $url = false;
if (!$current) { if (!$current) {
$httpUtils = new Utils\HTTP(); $httpUtils = new Utils\HTTP();
$url = htmlspecialchars($httpUtils->addURLParameters( $url = $httpUtils->addURLParameters(
'', '',
[$parameterName => $lang] [$parameterName => $lang]
)); );
} }
$langmap[$lang] = [ $langmap[$lang] = [
'name' => $langname, 'name' => $langname,
......
...@@ -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.
Please register or to comment