I've installed Location on a site I'm working on, and just added a location field to the profile content type (via Content Profile and CCK), and while things initially seemed fine, when I went to admin/user/user just now, I got the following error in a red box at the top of the page - 13 times in a row! (by which I mean that the error appeared 13 times in the box, not that I went there 13 times)

warning: preg_match() [function.preg-match]: Compilation failed: missing terminating ] for character class at offset 6 in /[path to modules directory]/location/location.module on line 942.

This error doesn't seem to appear anywhere in the issues queue, or at least did not come up when I searched for preg_match(). I checked the file location.module, and line 942 is:
if (preg_match($string, strtolower($name))) {
Which has no square brackets anywhere in it, and doesn't look like it should require any. The line in question is part of the function _location_autocomplete(), and I don't even know why that function would be being called on a page that's just a listing of users - there are no editable location fields being displayed on that page.

When I tried creating a sample profile, where the autocomplete fields were showing, I didn't encounter this error - why would I be getting it on a page with no autocomplete fields?

Any light anyone could shed on this would be much appreciated.

Comments

Balbo’s picture

I had the same error. Actually, looking in the dblog I have several of this error. The referrer is the page where user subscribe (and there I have a content profile with a cck-location) but it says the error is in the page "www.mysite.com/autocomplete/it/Barcellona%20(Spa". Any suggestions?

desoi’s picture

I have not looked at the code, but likely there is some logic missing to filter out bad input on the autocomplete. If the user enters "(" in the US state autocomplete, the Drupal log gets filled with this error:

preg_match() [function.preg-match]: Compilation failed: missing ) at offset 2 in /Users/desoi/Development/cs/web/csales/public_html/sites/all/modules/location/location.module on line 942.

Location of the error is: http://localhost/location/autocomplete/us/(

legolasbo’s picture

Status: Active » Closed (outdated)

Closing old D6 issues as D6 is end of life