vip-scanner
vip-scanner copied to clipboard
Adding three checks for non-escaped localization function calls.
The first checks if output of the __( ), _x( ), _n( ), _nx( ) functions is being printed directly, via echo( ), print( ) or vprintf( ) -- care is taken to ensure that both echo with and without brackets is considered, and same with print. These are blockers.
The second checks if __( ), _x( ), _n( ), _nx( ) functions are being called (without printing). These are warnings.
The third checks if _e( ) or _ex( ) are being called. These are blockers.
These checks are all against localization functions which do not HTML-escape. Not escaping can be dangerous since HTML code could be injected via malicous translation strings. Blocking was considered prudent with direct printing, because there is no escaping involved, whereas warnings are issued when strings are possibly escaped later on in processing.
This will resolve issue #287.