Failed Ajax request or invalid JSON returned trying to upload file to

Same issue as here: Pasting text OJS but no solution. This has worked without issues since OJS 2. How on earth is the browser distinguishing between text that is typed manually and text that is pasted? No special charcters when viewing the source either.