Permalink
Browse files

Tweaked validationto not throw random errors on top of stuff

  • Loading branch information...
jmather committed Apr 6, 2012
1 parent 4f50a44 commit e0f45320a79fcedde1419c2156b3616562211f0b
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/Majax/Twilio/Client.php
@@ -51,6 +51,9 @@ public function getAccountClient()
*/
public function validateRequest()
{
+ if (!isset($_SERVER['HTTP_HOST']) || !isset($_SERVER['REQUEST_URI']) || !isset($_SERVER['HTTP_X_TWILIO_SIGNATURE']))
+ return false;
+
$validator = new Services_Twilio_RequestValidator($this->auth_token);
$url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$signature = $_SERVER['HTTP_X_TWILIO_SIGNATURE'];

0 comments on commit e0f4532

Please sign in to comment.