Grunion_Contact_Form_Plugin::esc_csv PHP Method

esc_csv() public method

Malicious input can inject formulas into CSV files, opening up the possibility for phishing attacks and disclosure of sensitive information. Additionally, Excel exposes the ability to launch arbitrary commands through the DDE protocol.
See also: http://www.contextis.com/resources/blog/comma-separated-vulnerabilities/
public esc_csv ( string $field ) : string
$field string
return string
    function esc_csv($field)
    {
        $active_content_triggers = array('=', '+', '-', '@');
        if (in_array(mb_substr($field, 0, 1), $active_content_triggers, true)) {
            $field = "'" . $field;
        }
        return $field;
    }