Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 6b2fa12

Browse files
melangervyskocilpavel
authored andcommitted
read spName only if present
1 parent 45a9a2d commit 6b2fa12

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
1111
- Update README.md
1212
- describe setup for modes PROXY/SP/IDP
1313
- change array notation from `array()` to `[]`
14+
- Read spName from $request only if present
1415

1516
## [v3.1.0]
1617
#### Added

lib/Auth/Process/DatabaseCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ public static function insertLogin(&$request, &$date)
1919
$statisticsTableName = $databaseConnector->getStatisticsTableName();
2020
$identityProvidersMapTableName = $databaseConnector->getIdentityProvidersMapTableName();
2121
$serviceProvidersMapTableName = $databaseConnector->getServiceProvidersMapTableName();
22-
22+
2323
if (!in_array($databaseConnector->getMode(), ['PROXY', 'IDP', 'SP'])) {
2424
throw new Exception('Unknown mode is set. Mode has to be one of the following: PROXY, IDP, SP.');
2525
}
26-
26+
2727
if ($databaseConnector->getMode() !== 'IDP') {
2828
$idpName = $request['Attributes']['sourceIdPName'][0];
2929
$idpEntityID = $request['saml:sp:IdP'];
3030
}
3131
if ($databaseConnector->getMode() !== 'SP') {
3232
$spEntityId = $request['Destination']['entityid'];
33-
$spName = $request['Destination']['name']['en'];
33+
$spName = isset($request['Destination']['name']) ? $request['Destination']['name']['en'] : '';
3434
}
3535

3636
if ($databaseConnector->getMode() === 'IDP') {

0 commit comments

Comments
 (0)