better param parsing #36

Merged
coolaj86 merged 1 commits from params-parsing into master 5 years ago
coolaj86 commented 5 years ago
Owner

Removing any and all of the following leading characters before parsing the params: #/?.

  • #access_token=x&foo=bar => access_token=x&foo=bar
  • #/?access_token=x&foo=bar => access_token=x&foo=bar
  • #/access_token=x&foo=bar => access_token=x&foo=bar
  • #?access_token=x&foo=bar => access_token=x&foo=bar
Removing any and all of the following leading characters before parsing the params: `#/?`. * `#access_token=x&foo=bar` => `access_token=x&foo=bar` * `#/?access_token=x&foo=bar` => `access_token=x&foo=bar` * `#/access_token=x&foo=bar` => `access_token=x&foo=bar` * `#?access_token=x&foo=bar` => `access_token=x&foo=bar`
Ghost approved these changes 5 years ago
document.body.hidden = false;
var hash = window.location.hash.substr(1);
var hash = window.location.hash.replace(/^[\/#?]+/, '');
Ghost commented 5 years ago
Poster

Would #? to be safe, but I think inside a square bracket it's fine.

Would \#\? to be safe, but I think inside a square bracket it's fine.
Poster
Owner

true on both accounts

true on both accounts
coolaj86 closed this pull request 5 years ago
Poster
Owner

Thanks @mikegwhit

Thanks @mikegwhit
The pull request has been merged as f0049c7f06.
Sign in to join this conversation.
No reviewers
No Label feature
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.