protected function filterCsvInjection($input)
    {
        // Try to prevent csv injection
        $dangers = ['=', '+', '-', '@'];
        
        // Trim leading spaces for our test
        $trimmed = trim($input);
        
        if (strlen($trimmed)>1 && in_array($trimmed[0], $dangers)) {
            return "'" . $input;
        }  else {
            return $input;
        }
    }
protected function filterCsvInjection($input)
    {
        // Try to prevent csv injection
        $dangers = ['=', '+', '-', '@'];
        
        // Trim leading spaces for our test
        $trimmed = trim($input);
        
        if (strlen($trimmed)>1 && in_array($trimmed[0], $dangers)) {
            return "'" . $input;
        }  else {
            return $input;
        }
    }
protected function filterCsvInjection ( $ input ) { // Try to prevent csv injection $ dangers = [ '=' , '+' , '-' , '@' ] ; // Trim leading spaces for our test $ trimmed = trim ( $ input ) ; if ( strlen ( $ trimmed ) > 1 && in_array ( $ trimmed [ 0 ] , $ dangers ) ) { return "'" . $ input ; } else { return $ input ; } }
Single point for mitigating csv injection vulnerabilities

https://www.owasp.org/index.php/CSV_Injection

@param string $input
@return string
Single point for mitigating csv injection vulnerabilities