Hi

Thank you very much for a useful module

I am running the site on PHP 5.3.6 and it gives me bunch of the following warnings:
---------
Deprecated function: Function split() is deprecated in geonames_metadata_update() (line 67 of [error]
/var/www/mysite/sites/all/modules/contrib/geonames/geonames.module).
--------

Would you consider to change split() call for preg_split()?

For example:
Current code: $object = array_combine($field_names, split("\t", $line));
Code without warnings: $object = array_combine($field_names, preg_split('/\t/', $line));

What do you think?

Thank you

Comments

mgifford’s picture

Agreed.. This is definitely worth doing.

EDIT: Actually, it looks like it's already gone from the git repository.

mossy2100’s picture

Title: PHP warnings » PHP warnings re deprecated function split()

You don't need to replace split() with preg_split() in this instance, as these are not regular expressions. explode() is faster as it doesn't incur the overhead of the regular expression engine.

lyricnz’s picture

Status: Active » Fixed

That function has been explode() since May 10th 2011, just after the last official release. I'll make a new release today, once I look through the issue queue a bit more.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.