I am running a Symfony 2.8 based web app which sends some form data back to a controller using Ajax.
So far everything worked fine, but since the latest macOS update
I used Andrei's suggestion, which worked for safari, but broke IE.
The only solution I could find that would work in both browsers was to use eval().
Since this appears to be a bug only affecting safari 11 I also added a check on browser version.
if(dataObj instanceof FormData && navigator.userAgent.match(/version\/11((\.[0-9]*)*)? .*safari/i)) {
try {
eval('for (var pair of dataObj.entries()) {\
if (pair[1] instanceof File && pair[1].name === \'\' && pair[1].size === 0) {\
dataObj.delete(pair[0]);\
}\
}');
} catch(e) {}
}