Skip to content

Commit

Permalink
#2964 - Fixing urlencoding PG bug in iOS 6 and PG 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmadigan committed Jan 14, 2013
1 parent 36288af commit 4dda042
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion client/default/js/wufoo.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,9 +981,22 @@ $fh.ready(function() {
fileEntry.file(function gotFile(file) {
var reader = new FileReader();
reader.onloadend = function(evt) {
var text = evt.target.result;

// Check for URLencoded
// PG 2.2 bug in readAsText()
try {
text = decodeURIComponent(text);
console.log('decoded URLencoded file for key: ' + key);
} catch (e) {
// Swallow exception if not URLencoded
// Just use the result
console.log('file not urlencoded for key: ' + key);
}

return success({
key: key,
val: evt.target.result
val: text
});
};
reader.readAsText(file);
Expand Down

1 comment on commit 4dda042

@jimoleary101
Copy link
Contributor

Choose a reason for hiding this comment

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

looks good to me

Please sign in to comment.