coppers Posted September 23, 2008 Share Posted September 23, 2008 I'm having problems with a writelog script and special html characters or just special characters in general, I don't know what at this time, what is causing it to error. Does anyone know what special html characters (such as u2034 stuff and ♥) or other characters can error out writelog on a utf-8 encoded page? I have apos, quotes, and html brackets filtered already. Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 23, 2008 Share Posted September 23, 2008 Trying to create a blacklist of unsupported characters is not a good approach, IMHO, as there is always something you forget about. I think a better approach is to have a white list of supported characters. You can then strip out all unsupported characters with a simple regex expression. Quote Link to comment Share on other sites More sharing options...
coppers Posted September 24, 2008 Author Share Posted September 24, 2008 Well, no, I have to say I don't agree. Blacklisting is the best way to do this in my circumstance, I'd just like to know what could cause the writelog function to error. Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 24, 2008 Share Posted September 24, 2008 You need to provide the code for the writelog function if you want some help with it. As to special characters to be allowed. Do you want to allow the heart symbol (♥), the inifinity symbol (∞), sigma (Σ) or how about the control characters such as new line, page break, etc. All of those (and many, many more) might be causing your problems. Without knowing exactly what the input is that is breaking the function it is impossible to know what the problem is - or what other characters might break it. Basically if you fix it for the known problem characters now, there is no guarantee there are not others that will break it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.