Jump to content

htmlentities not working


robert_gsfame

Recommended Posts

i have this function to do the prevent html injection

 

function htmlentities(str) {

    var i,output='',len,char='';

    len = str.length;

    for(i=0;i47 && char<58)||(char>62 && char<127) ){

            output += str;

        }else{

            output += "&#" + str.charCodeAt(0) + ";";

        }

    }

    return output;

}

 

but this is not working,anyone got an idea??

 

thx

Link to comment
https://forums.phpfreaks.com/topic/209184-htmlentities-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.