Deprecated: preg_match in the latest csvImport.php

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 15, 2022   (RSS)

By daniel - June 14, 2022

Hi Karls,

Yes - we have some PHP 8 compatibility updates queued for a number of plugins, CSV Import included. In the meantime, I can give you the changes so that you can patch the plugin and remove the errors.


In csvImport.php

Line 58, change:

ini_set('auto_detect_line_endings', true);

to:

// ini_set('auto_detect_line_endings', true);

Line 119, change:

$onCustomMenu        = preg_match("/^_csv_import_menu_(\d+)$/", @$_REQUEST['menu'], $matches);

to:

$onCustomMenu        = preg_match("/^_csv_import_menu_(\d+)$/", $_REQUEST['menu']??'', $matches);

In csvImport_functions.php 

Line 1697, change:

foreach (explode("\n", $fieldMap) as $line) {

to:

foreach (explode("\n", $fieldMap??'') as $line) {

Let me know if you have any questions, or have any more issues after making these changes!

Thanks,

Daniel
Technical Lead
interactivetools.com

By ht1080z - June 15, 2022

Thank you Daniel!