1EdTech / lti-1-3-php-library

Apache License 2.0
117 stars 105 forks source link

get_response_jwt crashes when deep_link_settings['data'] is not set #63

Open etsikt opened 2 years ago

etsikt commented 2 years ago

Steps to reproduce:

  1. Issue a deep linking request message without specifying deep_link_settings['data'].
  2. Respond using output_response_form function in LTI_Deep_Link.php
  3. Notice that the code crashes because deep_link_settings['data'] is not set: [2021-11-02 15:26:50] production.ERROR: Undefined index: data {"exception":"[object] (ErrorException(code: 0): Undefined index: data at /var/www/vendor/imsglobal/lti-1p3-tool/src/lti/LTI_Deep_Link.php:28) Link to GitHUB: https://github.com/IMSGlobal/lti-1-3-php-library/blob/3a192de99f3783d76caea462b0d04db28569c123/src/lti/LTI_Deep_Link.php#L28

Expected behaviour: According to https://www.imsglobal.org/spec/lti-dl/v2p0#deep-linking-settings data is not a required value, and the code should therefore check whether it is set or not and handle both situations.

sunny047 commented 2 years ago

Hi,

Any update on this issue? I am testing this library in a laravel and facing this issue while using the output_response_form function.

etsikt commented 2 years ago

I ended up doing a fork with these changes: https://github.com/matematikk-mooc/lti-1-3-php-library/commit/eb6a4fba895ac42d9344b0371b50c5eceedb4983