Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored November 28, 2011 stronk7 committed November 29, 2011

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  mod/lti/OAuthBody.php
6  mod/lti/OAuthBody.php
@@ -83,8 +83,10 @@ function handleOAuthBodyPOST($oauth_consumer_key, $oauth_consumer_secret, $body,
83 83
     }
84 84
 
85 85
     // Must reject application/x-www-form-urlencoded
86  
-    if ($request_headers['Content-type'] == 'application/x-www-form-urlencoded' ) {
87  
-        throw new Exception("OAuth request body signing must not use application/x-www-form-urlencoded");
  86
+    if (isset($request_headers['Content-type'])) {
  87
+        if ($request_headers['Content-type'] == 'application/x-www-form-urlencoded' ) {
  88
+            throw new Exception("OAuth request body signing must not use application/x-www-form-urlencoded");
  89
+        }
88 90
     }
89 91
 
90 92
     if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") {

0 notes on commit cc6a4b0

Please sign in to comment.
Something went wrong with that request. Please try again.