 b01671213a
			
		
	
	
		b01671213a
		
			
		
	
	
	
	
		
			
			Removed "unescape enclosure functionality", since the unescaping is already handled by fgetcsv, and performing the unescaping again would actually result int the text from the cell being read wrong. As an example try parsing the folowing CSV: ``` "<img alt="""" src=""http://example.com/image.jpg"" />" ``` With the additional unescaping it would have ended up as: ``` <img alt=" src="http://example.com/image.jpg" /> ``` instead of the correct: ``` <img alt="" src="http://example.com/image.jpg" /> ``` Fixes https://github.com/PHPOffice/PHPExcel/pull/1171
		
			
				
	
	
		
			28 lines
		
	
	
		
			999 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			999 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace PhpOffice\PhpSpreadsheetTests\Reader;
 | |
| 
 | |
| use PhpOffice\PhpSpreadsheet\Shared\File;
 | |
| use PhpOffice\PhpSpreadsheet\Spreadsheet;
 | |
| 
 | |
| class CsvTest extends \PHPUnit_Framework_TestCase
 | |
| {
 | |
|     public function testEnclosure()
 | |
|     {
 | |
|         $value = '<img alt="" src="http://example.com/image.jpg" />';
 | |
|         $filename = tempnam(File::sysGetTempDir(), 'phpspreadsheet');
 | |
| 
 | |
|         // Write temp file with value
 | |
|         $spreadsheet = new Spreadsheet();
 | |
|         $spreadsheet->getActiveSheet()->getCell('A1')->setValue($value);
 | |
|         $writer = new \PhpOffice\PhpSpreadsheet\Writer\Csv($spreadsheet);
 | |
|         $writer->save($filename);
 | |
| 
 | |
|         // Read written file
 | |
|         $reader = new \PhpOffice\PhpSpreadsheet\Reader\Csv();
 | |
|         $reloadedSpreadsheet = $reader->load($filename);
 | |
|         $actual = $reloadedSpreadsheet->getActiveSheet()->getCell('A1')->getCalculatedValue();
 | |
|         $this->assertSame($value, $actual, 'should be able to write and read strings with multiples quotes');
 | |
|     }
 | |
| }
 |