Use encodeURIComponent() instead of escape()

pull/1/head
Grégory Oestreicher 2017-02-27 14:00:32 +01:00
parent b17fd5efb2
commit f96dbe70e6
1 changed files with 5 additions and 5 deletions

View File

@ -250,10 +250,10 @@ function _sendAuthRequest( props, cb )
var http = new XMLHttpRequest(); var http = new XMLHttpRequest();
var params = "grant_type=password"; var params = "grant_type=password";
params += "&username=" + escape( props.user ); params += "&username=" + encodeURIComponent( props.user );
params += "&password=" + escape( props.password ); params += "&password=" + encodeURIComponent( props.password );
params += "&client_id=" + escape( props.clientId ); params += "&client_id=" + encodeURIComponent( props.clientId );
params += "&client_secret=" + escape( props.clientSecret ); params += "&client_secret=" + encodeURIComponent( props.clientSecret );
http.onreadystatechange = function() { http.onreadystatechange = function() {
if ( http.readyState === XMLHttpRequest.DONE ) { if ( http.readyState === XMLHttpRequest.DONE ) {
@ -533,7 +533,7 @@ function uploadNewArticle( props, articleUrl, cb )
url += "/"; url += "/";
url += "api/entries.json"; url += "api/entries.json";
var params = "url=" + escape( articleUrl ); var params = "url=" + encodeURIComponent( articleUrl );
var http = new XMLHttpRequest; var http = new XMLHttpRequest;