[OSM-talk] fuel type suggestions

Dave Stubbs osm.list at randomjunk.co.uk
Mon Aug 20 11:22:51 BST 2007


> > Seems to me the problem is the use of the semicolon as the seperator
> > somewhere in the ruby code, perhaps that should be changed? At the
> > very least it should be some character that's actually illegal in tag,
> > like some control character.  I often use Ctrl-A or the null character
> > for this. Using the semicolon while not forbidding it in the API shows
> > insufficient use of quoting.
>
> Well obviously, it's a bug! I was just explaining what has happened.
>
> I notice that nobody has cared enough to provide a fix, or even to
> enter a trac ticket for it.



"Everybody stand back, I know regular expressions..." [1]

In the split_tags method instead of tags.split... do:
  tags.scan( /(.*?=[^=]*)(?:;|$)/ ) do |tag|    ...

This will effectively split tags based on the combined presence of = and ;
rather than just one or the other.
It fixes the whole PGS blah thing.
It's still fairly trivial to come up with strings that break it, but they
mostly rely on using equals.
; and = should really be escaped. But that requires a much bigger fix.


Dave

[1] http://xkcd.com/208/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20070820/f1066370/attachment.html>


More information about the talk mailing list