Skip to content

Commit ac39fbd

Browse files
nordlolektvdijen
authored andcommitted
Fetch PrivacyStatementURL from UIInfo PrivacyStatementURL before deprecated privacypolicy (#6)
* Fetch Source and Destination PrivacyStatementURL and make it precedence over deprecated privacypolicy
1 parent 1006873 commit ac39fbd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

www/getconsent.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,12 @@
160160
$t->data['dstName'] = $dstName;
161161

162162
// Fetch privacypolicy
163-
if (array_key_exists('privacypolicy', $state['Destination'])) {
163+
if (array_key_exists('PrivacyStatementURL', $state['Destination']['UIInfo']) && (!empty($state['Destination']['UIInfo']['PrivacyStatementURL']))) {
164+
$privacypolicy = reset($state['Destination']['UIInfo']['PrivacyStatementURL']);
165+
} elseif (array_key_exists('privacypolicy', $state['Destination'])) {
164166
$privacypolicy = $state['Destination']['privacypolicy'];
167+
} elseif (array_key_exists('PrivacyStatementURL', $state['Source']['UIInfo']) && (!empty($state['Source']['UIInfo']['PrivacyStatementURL']))) {
168+
$privacypolicy = reset($state['Source']['UIInfo']['PrivacyStatementURL']);
165169
} elseif (array_key_exists('privacypolicy', $state['Source'])) {
166170
$privacypolicy = $state['Source']['privacypolicy'];
167171
} else {

0 commit comments

Comments
 (0)