Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-30400 lti: Fixing warning in OAuthBodyPost

This would have only shown up if the tool provider didn't set the
content-type header, which I don't think is valid to begin with.

(amended by integrator to follow coding style rules)
  • Loading branch information...
commit cc6a4b0ecd50304a0b784445eec231b4bab5b95c 1 parent ab83fa5
@scriby scriby authored stronk7 committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 mod/lti/OAuthBody.php
View
6 mod/lti/OAuthBody.php
@@ -83,8 +83,10 @@ function handleOAuthBodyPOST($oauth_consumer_key, $oauth_consumer_secret, $body,
}
// Must reject application/x-www-form-urlencoded
- if ($request_headers['Content-type'] == 'application/x-www-form-urlencoded' ) {
- throw new Exception("OAuth request body signing must not use application/x-www-form-urlencoded");
+ if (isset($request_headers['Content-type'])) {
+ if ($request_headers['Content-type'] == 'application/x-www-form-urlencoded' ) {
+ throw new Exception("OAuth request body signing must not use application/x-www-form-urlencoded");
+ }
}
if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") {
Please sign in to comment.
Something went wrong with that request. Please try again.