]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/wp-gears.dev.js
Wordpress 2.9
[autoinstalls/wordpress.git] / wp-admin / js / wp-gears.dev.js
index 3e9519c478c0c5b7c909bd7fd0f6554e78e26d48..b91ace7e1f480b24ce193c42797fcb6fa40fa6b4 100644 (file)
@@ -28,9 +28,13 @@ var wpGears = {
        },
 
        storeName : function() {
-               var name = window.location.protocol + window.location.host;
+               var name, host = window.location.host;
 
-               name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name
+               if ( host.match(/[^a-z0-9._-]/i) )
+                       host = encodeURIComponent(host);
+               
+               name = window.location.protocol + host;
+               name = name.replace(/[^a-z0-9._-]+/gi, '_');
                name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars
 
                return name;