HEX
Server:Apache
System:Linux localhost 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64
User:enlugo-es (10006)
PHP:7.4.33
Disabled:opcache_get_status
Upload Files
File: /var/www/vhosts/enlugo.es/httpdocs/wp-content/plugins/google-maps-ready/classes/csvgenerator.php
<?php
class csvgeneratorGmp {
    protected $_filename = '';
    protected $_delimiter = ';';
    protected $_enclosure = "\n";
    protected $_data = array();
	protected $_escape = '\\';
    public function __construct($filename) {
        $this->_filename = $filename;
    }
    public function addCell($x, $y, $value) {
        $this->_data[ $x ][ $y ] = '"'. $value. '"';    //If will not do "" then wymbol for example , will broke file
    }
    public function generate() {
        $strData = '';
        if(!empty($this->_data)) {
            $rows = array();
            foreach($this->_data as $cells) {
                $rows[] = implode($this->_delimiter, $cells);
            }
            $strData = implode($this->_enclosure, $rows);
        }
        filegeneratorGmp::_($this->_filename, $strData, 'csv')->generate();
    }
	public function getDelimiter() {
		return $this->_delimiter;
	}
	public function getEnclosure() {
		return $this->_enclosure;
	}
	public function getEscape() {
		return $this->_escape;
	}
}