Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1943d5

Browse files
committed
Allow false and 0 to be added to base string properly
1 parentfab1323 commitd1943d5

File tree

4 files changed

+30
-8
lines changed

4 files changed

+30
-8
lines changed

‎dist/oauth-signature.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>
2828
/*! url - v1.8.6 - 2013-11-22 */window.url=function(){functiona(a){return!isNaN(parseFloat(a))&&isFinite(a)}returnfunction(b,c){vard=c||window.location.toString();if(!b)returnd;b=b.toString(),"//"===d.substring(0,2)?d="http:"+d:1===d.split("://").length&&(d="http://"+d),c=d.split("/");vare={auth:""},f=c[2].split("@");1===f.length?f=f[0].split(":"):(e.auth=f[0],f=f[1].split(":")),e.protocol=c[0],e.hostname=f[0],e.port=f[1]||("https"===e.protocol.split(":")[0].toLowerCase()?"443":"80"),e.pathname=(c.length>3?"/":"")+c.slice(3,c.length).join("/").split("?")[0].split("#")[0];varg=e.pathname;"/"===g.charAt(g.length-1)&&(g=g.substring(0,g.length-1));varh=e.hostname,i=h.split("."),j=g.split("/");if("hostname"===b)returnh;if("domain"===b)return/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(h)?h:i.slice(-2).join(".");if("sub"===b)returni.slice(0,i.length-2).join(".");if("port"===b)returne.port;if("protocol"===b)returne.protocol.split(":")[0];if("auth"===b)returne.auth;if("user"===b)returne.auth.split(":")[0];if("pass"===b)returne.auth.split(":")[1]||"";if("path"===b)returne.pathname;if("."===b.charAt(0)){if(b=b.substring(1),a(b))returnb=parseInt(b,10),i[0>b?i.length+b:b-1]||""}else{if(a(b))returnb=parseInt(b,10),j[0>b?j.length+b:b]||"";if("file"===b)returnj.slice(-1)[0];if("filename"===b)returnj.slice(-1)[0].split(".")[0];if("fileext"===b)returnj.slice(-1)[0].split(".")[1]||"";if("?"===b.charAt(0)||"#"===b.charAt(0)){vark=d,l=null;if("?"===b.charAt(0)?k=(k.split("?")[1]||"").split("#")[0]:"#"===b.charAt(0)&&(k=k.split("#")[1]||""),!b.charAt(1))returnk;b=b.substring(1),k=k.split("&");for(varm=0,n=k.length;n>m;m++)if(l=k[m].split("="),l[0]===b)returnl[1]||"";returnnull}}return""}}(),"undefined"!=typeofjQuery&&jQuery.extend({url:function(a,b){returnwindow.url(a,b)}});
2929
;(function(){
3030
'use strict';
31-
31+
3232
// Check the existence of module and module.exports to detect node
3333
varisNode=(typeofmodule!='undefined'&&typeofmodule.exports!='undefined');
34-
34+
3535
functionOAuthSignature(){
3636
}
3737

@@ -210,7 +210,15 @@ e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>
210210
varkey;
211211
for(keyinparameters){
212212
if(parameters.hasOwnProperty(key)){
213-
this._loadParameterValue(key,parameters[key]||'');
213+
varstringValue=parameters[key]||'';
214+
215+
try{
216+
if(typeofparameters[key]==='number'||typeofparameters[key]==='boolean'){
217+
stringValue=parameters[key].toString();
218+
}
219+
}catch(e){}
220+
221+
this._loadParameterValue(key,stringValue);
214222
}
215223
}
216224
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp