EscapeFormula
class EscapeFormula (View source)
A League CSV formatter to tackle CSV Formula Injection.
Constants
| FORMULA_STARTING_CHARS | 
                     Spreadsheet formula starting character.  | 
            
Properties
| protected array | $special_chars | Effective Spreadsheet formula starting characters.  | 
                |
| protected string | $escape | Escape character to escape each CSV formula field.  | 
                
Methods
                    __construct(string $escape = "\t", array $special_chars = [])
        
                                            
                
            New instance.
                    string[]
                
                
                    filterSpecialCharacters(array $characters)
        
                                            
                
            Filter submitted special characters.
                    string[]
                
                
                    getSpecialCharacters()
        
                                            
                
            Returns the list of character the instance will escape.
                    string
                
                
                    getEscape()
        
                                            
                
            Returns the escape character.
                    __invoke(array $record)
        
                                            
                
            League CSV formatter hook.
                    array
                
                
                    escapeRecord(array $record)
        
                                            
                
            Escape a CSV record.
                    string
                
                
                    escapeField($cell)
        
                                            
                
            Escape a CSV cell.
                    bool
                
                
                    isStringable($value)
        
                                            
                
            Tell whether the submitted value is stringable.
Details
        
                            
    __construct(string $escape = "\t", array $special_chars = [])
        
    
    New instance.
        
                    protected        string[]
    filterSpecialCharacters(array $characters)
        
    
    Filter submitted special characters.
        
                            string[]
    getSpecialCharacters()
        
    
    Returns the list of character the instance will escape.
        
                            string
    getEscape()
        
    
    Returns the escape character.
        
                            
    __invoke(array $record)
        
    
    League CSV formatter hook.
        
                            array
    escapeRecord(array $record)
        
    
    Escape a CSV record.
        
                    protected        string
    escapeField($cell)
        
    
    Escape a CSV cell.
        
                    protected        bool
    isStringable($value)
        
    
    Tell whether the submitted value is stringable.