Match wikipedia language prefixes case insensitively
authorPaweł Paprota <ppawel@fastmail.fm>
Fri, 5 Oct 2012 18:38:46 +0000 (20:38 +0200)
committerTom Hughes <tom@compton.nu>
Sun, 7 Oct 2012 15:03:10 +0000 (16:03 +0100)
Without this values like "PL:Article" are linked to the English Wikipedia.

app/helpers/browse_helper.rb

index ea17b8202d1a9a4ac7b9493c8deb234aa00a34b7..c4e4d425a5ef997a97dbb84cc2d75eeac53a5cac 100644 (file)
@@ -97,7 +97,7 @@ private
     if key == "wikipedia"
       # This regex should match Wikipedia language codes, everything
       # from de to zh-classical
-      if value =~ /^([a-z-]{2,12}):(.+)$/
+      if value =~ /^([a-z-]{2,12}):(.+)$/i
         # Value is <lang>:<title> so split it up
         # Note that value is always left as-is, see: https://trac.openstreetmap.org/ticket/4315
         lang  = $1