3 ms·
Any time I think about HTML sanitization I think about MySpace and how the engineers there never parsed user authored HTML, they just searched for substrings in
by andrewmcwatters 6y ago
Any time I think about HTML sanitization I think about MySpace and how the engineers there never parsed user authored HTML, they just searched for substrings in the input which allowed users to craft some really funky HTML that was valid, but unconventional.
Interesting times. Also a good example of how when you work at a company as a developer, not every issue you come across you’ll have time to fix or may even know how to.
Tools proliferated years later to help with this sort of thing, but it’s interesting to think after many years that such a common concern had not really been explicitly addressed in standards as far as I know.
- megous 6y agoThere's a DOMParser as a part of platform api, that I've been using for maaany years for this. https://developer.mozilla.org/en-US/docs/Web/API/DOMParser https://developer.mozilla.org/en-US/docs/Web/API/DOMParser On top you just write some recursive tree sifting whitelist based function, for your expected input.