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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -