code/libraries/joomlatools/library/view/csv.php
protected function _quoteValue($value)
    {
        if(is_numeric($value)) {
            return false;
        }

        if(strpos($value, $this->separator) !== false) { // Separator is present in field
            return true;
        }

        if(strpos($value, $this->quote) !== false) { // Quote character is present in field
            return true;
        }

        if (strpos($value, "\n") !== false || strpos($value, "\r") !== false ) { // Newline is present in field
            return true;
        }

        if(substr($value, 0, 1) == " " || substr($value, -1) == " ") {  // Space found at beginning or end of field value
            return true;
        }

        return false;
    }
protected function _quoteValue($value)
    {
        if(is_numeric($value)) {
            return false;
        }

        if(strpos($value, $this->separator) !== false) { // Separator is present in field
            return true;
        }

        if(strpos($value, $this->quote) !== false) { // Quote character is present in field
            return true;
        }

        if (strpos($value, "\n") !== false || strpos($value, "\r") !== false ) { // Newline is present in field
            return true;
        }

        if(substr($value, 0, 1) == " " || substr($value, -1) == " ") {  // Space found at beginning or end of field value
            return true;
        }

        return false;
    }
protected function _quoteValue ( $ value ) { if ( is_numeric ( $ value ) ) { return false ; } if ( strpos ( $ value , $ this -> separator ) !== false ) { // Separator is present in field return true ; } if ( strpos ( $ value , $ this -> quote ) !== false ) { // Quote character is present in field return true ; } if ( strpos ( $ value , "\n" ) !== false || strpos ( $ value , "\r" ) !== false ) { // Newline is present in field return true ; } if ( substr ( $ value , 0 , 1 ) == " " || substr ( $ value , - 1 ) == " " ) { // Space found at beginning or end of field value return true ; } return false ; }
Check if the value should be quoted

@param   string  $value Value
@return  boolean
Check if the value should be quoted