Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added method in OAuth for checking redirect url #392

Open
wants to merge 1 commit into
base: 3.5.x
Choose a base branch
from

Conversation

sergeysviridenko
Copy link
Contributor

Hello!

  • Type: new feature
  • Link to issue:

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR

Small description of change:
Added method for checking GITHUB_REDIRECT_URI param from Github authorization

Thanks

*
* @return string
*/
protected function getRedirectGitPath($url, $endSlash = true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergeysviridenko Where is this method used? :)

@sergeysviridenko sergeysviridenko force-pushed the 3.git_redirect_method branch 4 times, most recently from 699e62f to 16ad361 Compare August 18, 2017 15:52
@sergeysviridenko sergeysviridenko changed the title added method in OAuth for add proper redirect url added method in OAuth for checking redirect url Aug 18, 2017
@sergeysviridenko sergeysviridenko force-pushed the 3.git_redirect_method branch 2 times, most recently from e3cf11e to 3a7d61f Compare August 19, 2017 12:55
protected function checkRedirectGitPath($url)
{
if (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED |
FILTER_FLAG_PATH_REQUIRED)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$validationFlags = FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED;

if (!filter_var($url, FILTER_VALIDATE_URL, $validationFlags)) {
    // ...
}


namespace Phosphorum\Exception;

class UrlException extends \LogicException
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InvalidCalbackUrlException

}

if (stristr($url, '://', true) != $this->request->getScheme()) {
$errorMessage = 'HyperText Protocol in your application and in your setting file are different. ';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same protocol should be used for the authorization callback URL and forum settings.

@sergeyklay sergeyklay changed the base branch from 3.x to 3.5.x April 25, 2018 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants