Created
February 13, 2013 11:31
-
-
Save niraj-shah/4943992 to your computer and use it in GitHub Desktop.
Updated Facebook Base SDK for PHP 5.4.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function getCode() { | |
$server_info = array_merge($_GET, $_POST, $_COOKIE); | |
if (isset($server_info['code'])) { | |
if ($this->state !== null && | |
isset($server_info['state']) && | |
$this->state === $server_info['state']) { | |
// CSRF state has done its job, so clear it | |
$this->state = null; | |
$this->clearPersistentData('state'); | |
return $server_info['code']; | |
} else { | |
self::errorLog('CSRF state token does not match one provided.'); | |
return false; | |
} | |
} | |
return false; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment