php - Making a string safe by removing all javascript codes and events -



php - Making a string safe by removing all javascript codes and events -

i want remove javascript codes string contains html code.

for illustration these unwanted javascript codes may cause problems on website:

<div onmouseover='window.location = "http://to-undesirable-location"'></div>

or

<img onload='window.location = "http://to-undesirable-location"'></img>

or

<script language="javascript> ...unwanted code... </script>

since hackers can utilize js functions redirect page unwanted pages wonder why there not source create type of content safe... on website there simple wysiwyg editor users can set html content within it.

thanks

i've heard things on stack overflow html purifier.

php

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -