LTI: Fix replacement for variables + fix removing whitespaces

pull/3065/head
Angel Fernando Quiroz Campos 6 years ago
parent e5c50eaa76
commit bd8a4b1465
  1. 6
      plugin/ims_lti/auth.php
  2. 18
      plugin/ims_lti/src/ImsLti.php

@ -220,8 +220,10 @@ try {
array_walk_recursive(
$jwtContent,
function (&$value) {
$value = preg_replace('/\s+/', ' ', $value);
$value = trim($value);
if (gettype($value) === 'string') {
$value = preg_replace('/\s+/', ' ', $value);
$value = trim($value);
}
}
);

@ -120,7 +120,9 @@ class ImsLti
? $substitute['claim']
: "https://purl.imsglobal.org/spec/lti{$substitute['claim']}";
$substitute = $launchParams[$claim][$substitute['property']];
$substitute = empty($substitute['property'])
? $launchParams[$claim]
: $launchParams[$claim][$substitute['property']];
} else {
continue;
}
@ -129,12 +131,16 @@ class ImsLti
$customParams[$customKey] = $substitute;
}
return array_map(
function ($value) {
return (string) $value;
},
$customParams
array_walk_recursive(
$customParams,
function (&$value) {
if (gettype($value) !== 'array') {
$value = (string) $value;
}
}
);
return $customParams;
}
/**

Loading…
Cancel
Save