Are apache environment variables ASCII (as reflected in PHP $_SERVER)? -


i'm sanitizing user_agent logging in php , need know whether use substr() or mb_strcut().

seeing how user_agent directly derived http request header user-agent, i'm going assume you're interested in http headers.

is possible http headers contain bytes outside 7-bit ascii range? yes.

is you'll see in practice , need handle properly? i'd no.

therefore suggest third option: first strip non-ascii characters string, use regular multibyte-unsafe functions heart's content.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -