better param parsing #36

已合併
coolaj86 2019-05-29 21:38:17 +00:00 將 1 次代碼提交從 params-parsing 合併至 master
管理員

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 2019-05-29 01:49:48 +00:00
@ -4,3 +4,3 @@
document.body.hidden = false;
var hash = window.location.hash.substr(1);
var hash = window.location.hash.replace(/^[\/#?]+/, '');
First-time contributor

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.
Author
管理員

true on both accounts

true on both accounts
coolaj86 closed this pull request 2019-05-29 21:38:17 +00:00
Author
管理員

Thanks @mikegwhit

Thanks @mikegwhit
登入 才能加入這對話。
No reviewers
未選擇標籤
feature
未選擇里程碑
No Assignees
2 參與者
訊息
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coolaj86/telebit.js#36
No description provided.