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
Post a Comment