fix PHP 8.0 ValueError: fgetcsv(): Argument #3 ($separator) must be a single character

This commit is contained in:
Ralf Becker 2021-11-16 08:37:54 +01:00
parent a50139fa24
commit 39c93ac9ca

View File

@ -83,12 +83,12 @@ class importexport_import_csv implements importexport_iface_import_record { //,
* @param string $_resource resource containing data. May be each valid php-stream * @param string $_resource resource containing data. May be each valid php-stream
* @param array $_options options for the resource array with keys: charset and fieldsep * @param array $_options options for the resource array with keys: charset and fieldsep
*/ */
public function __construct( $_resource, array $_options ) { public function __construct( $_resource, array $_options )
{
$this->resource = $_resource; $this->resource = $_resource;
$this->csv_fieldsep = $_options['fieldsep']; $this->csv_fieldsep = $_options['fieldsep'][0];
if($_options['charset'] == 'user') $_options['charset'] = $GLOBALS['egw_info']['user']['preferences']['common']['csv_charset']; if($_options['charset'] == 'user') $_options['charset'] = $GLOBALS['egw_info']['user']['preferences']['common']['csv_charset'];
$this->csv_charset = $_options['charset']; $this->csv_charset = $_options['charset'];
return;
} // end of member function __construct } // end of member function __construct
/** /**