Skip to content

Instantly share code, notes, and snippets.

@drogers98
Created March 18, 2014 19:56
Show Gist options
  • Save drogers98/9628120 to your computer and use it in GitHub Desktop.
Save drogers98/9628120 to your computer and use it in GitHub Desktop.
nginx drupal oAuth module patch to settings.php. Lets oAuth run on Pantheon, yeay! Thanks to chustedde, https://drupal.org/comment/8475539#comment-8475539
// Modify server variables to be compatible with the OAuth.php library
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
$_SERVER['SERVER_PORT'] = 443;
}
else {
$_SERVER['SERVER_PORT'] = 80;
}
$_SERVER['QUERY_STRING'] = preg_replace("/&{0,1}q=[^&]*&{0,1}/i", "", $_SERVER['QUERY_STRING']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment