Warning: preg_split() [function.preg-split]: No ending delimiter ',' found in /home/ffchos

Hello,

When I go to look at the mapped domain chart I see this error under the DNS configuration for my mapped domains.

Warning: preg_split() [function.preg-split]: No ending delimiter ',' found in /home/ffchosti/public_html/wp-content/plugins/domain-mapping/classes/class.domainmap.php on line 667

Warning: Invalid argument supplied for foreach() in /home/ffchosti/public_html/wp-content/plugins/domain-mapping/classes/class.domainmap.php on line 668

Both are under each domain.

The domain still shows as valid and is still mapped in the real world.

  • Vinod Dalvi

    Hi @Free For Charity,

    Thanks for posting on the forum.

    I have tested it on my test site but didn't face any warning messages that you are facing.

    These are simple PHP warnings and most of the time it doesn't affect functionality of site so it is nothing to worry about!

    Do you have WP_DEBUG set to true in your wp-config.php file?

    If you do then please set it to false.
    This will hide the warning messages and you will be able to use your site normally.

    Alternatively you can try to fix it by changing the code in the following Domain Mapping plugin file on line number 666 as displayed below.

    Domain Mapping plugin file:
    wp-content/plugins/domain-mapping/classes/class.domainmap.php

    Before Editing:

    // Multiple CNAME not supported, so assume A
    $_records = preg_split(',', $map_ipaddress);
    foreach ($_records as $record) {
        $records[] = array('host' => $mapping->domain, 'type' => 'A', 'target' => $record);
    }

    After Editing :

    // Multiple CNAME not supported, so assume A
        $_records = preg_split('/\,/', $map_ipaddress);
        if( ! empty($_records) ){
        foreach ($_records as $record) {
            $records[] = array('host' => $mapping->domain, 'type' => 'A', 'target' => $record);
        }
    }

    or
    After Editing :

    // Multiple CNAME not supported, so assume A
        $_records = preg_split(',', $map_ipaddress);
        if( ! empty($_records) ){
        foreach ($_records as $record) {
            $records[] = array('host' => $mapping->domain, 'type' => 'A', 'target' => $record);
        }
    }

    Note: You are making changes in the plugin file and these changes will be overwritten and lost when you update the plugin and you will have to make these changes again after plugin updation.

    Best Regards,
    Vinod Dalvi