Index: tests/Util.html
===================================================================
--- tests/Util.html	(revision 10635)
+++ tests/Util.html	(working copy)
@@ -894,7 +894,7 @@
     }
 
     function test_Util_getParameters(t) {
-        t.plan(13);
+        t.plan(14);
 
         t.eq(OpenLayers.Util.getParameters('http://www.example.com'), {},
              "getParameters works when args = ''");
@@ -918,6 +918,9 @@
         t.eq(OpenLayers.Util.getParameters('http://www.example.com?foo=bar%3Aone%2Cpub%2Cdisco'),
              {'foo': ['bar:one', 'pub', 'disco']},
              "getParameters works with a URL encoded comma-separated values (parses into array)");
+        t.eq(OpenLayers.Util.getParameters('http://www.example.com?foo=a&foo=b'),
+             {'foo': ['a', 'b']},
+             "getParameters works with a URL which contains two parameters with the same name");
         
         var value = "%20";  // say you wanted to have a query string parameter value be literal "%20"
         var encoded = encodeURIComponent(value); // this is the proper URI component encoding
Index: lib/OpenLayers/Util.js
===================================================================
--- lib/OpenLayers/Util.js	(revision 10635)
+++ lib/OpenLayers/Util.js	(working copy)
@@ -1071,10 +1071,18 @@
             if (value.length == 1) {
                 value = value[0];
             }                
-            
+            // if there was already a parameter with this name, create
+            // an array with the values                
+            if (parameters[key] !== undefined && !(parameters[key] instanceof Array)) {
+                parameters[key] = [parameters[key]];
+            }
+            if (parameters[key] instanceof Array) {
+                parameters[key].push(value);
+            } else {
             parameters[key] = value;
          }
      }
+     }
     return parameters;
 };
 
