Skip to content

Instantly share code, notes, and snippets.

@Zegnat
Created July 27, 2017 14:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zegnat/365769e7b58ca4ddea481a9ef6145647 to your computer and use it in GitHub Desktop.
Save Zegnat/365769e7b58ca4ddea481a9ef6145647 to your computer and use it in GitHub Desktop.
<?php
// Make an array of all individual scopes. Scopes are delimitted by a space in IndieAuth.
$scopes = explode(' ', $scope);
// Now check in the new $scopes array if any elements match.
if (!in_array('create', $scopes) && !in_array('post', $scopes)) {
// Could not find 'create' or 'post'. Error time.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment