? .DS_Store
? autocomplete.patch
? block.patch
? break_php_0.patch
? comment.anchor.patch
? comment.anchor.patch.1
? comment_nid.patch.txt
? common.patch
? destination.patch
? destination_3.patch
? files
? filter.module.diff.txt
? misc.patch
? offline_message.patch_0.txt
? profile-date.patch
? profile.module_21.patch
? profile.patch
? profile_24.patch
? search.patch
? search_box_align.patch.txt
? search_fapi_convert_5.patch.txt
? system.module.revert-date.patch
? theme.inc.no_logo.patch
? toggle_logo.patch
? toggle_logo.patch.txt
? update.fatal.error.patch
? upload-form-alter-attributes.patch
? modules/module_builder
? sites/192.168.0.2
? sites/localhost.drupal
? themes/.DS_Store
? themes/bluebeach
? themes/friendselectric
? themes/schaak
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.530
diff -u -r1.530 common.inc
--- includes/common.inc	4 Apr 2006 07:46:02 -0000	1.530
+++ includes/common.inc	5 Apr 2006 12:00:27 -0000
@@ -1237,24 +1237,6 @@
 }
 
 /**
- * Implode a PHP array into a string that can be decoded by the autocomplete JS routines.
- *
- * Items are separated by double pipes. Each item consists of a key-value pair
- * separated by single pipes. Entities are used to ensure pipes in the strings
- * pass unharmed.
- *
- * The key is what is filled in in the text-box (plain-text), the value is what
- * is displayed in the suggestion list (HTML).
- */
-function drupal_implode_autocomplete($array) {
-  $output = array();
-  foreach ($array as $k => $v) {
-    $output[] = str_replace('|', '&#124;', $k) .'|'. str_replace('|', '&#124;', $v);
-  }
-  return implode('||', $output);
-}
-
-/**
  * Wrapper around urlencode() which avoids Apache quirks.
  *
  * Should be used when placing arbitrary data in an URL. Note that Drupal paths
Index: misc/autocomplete.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/autocomplete.js,v
retrieving revision 1.9
diff -u -r1.9 autocomplete.js
--- misc/autocomplete.js	5 Apr 2006 00:53:16 -0000	1.9
+++ misc/autocomplete.js	5 Apr 2006 12:00:28 -0000
@@ -197,18 +197,20 @@
   }
   var ul = document.createElement('ul');
   var ac = this;
-  if (matches.length > 0) {
-    for (var i = 0; i < matches.length; i++) {
-      li = document.createElement('li');
-      div = document.createElement('div');
-      div.innerHTML = matches[i][1];
-      li.appendChild(div);
-      li.autocompleteValue = matches[i][0];
-      li.onmousedown = function() { ac.select(this); };
-      li.onmouseover = function() { ac.highlight(this); };
-      li.onmouseout  = function() { ac.unhighlight(this); };
-      ul.appendChild(li);
-    }
+
+  for (key in matches) {
+    var li = document.createElement('li');
+    var div = document.createElement('div');
+    div.innerHTML = matches[key];
+    li.appendChild(div);
+    li.autocompleteValue = key;
+    li.onmousedown = function() { ac.select(this); };
+    li.onmouseover = function() { ac.highlight(this); };
+    li.onmouseout  = function() { ac.unhighlight(this); };
+    ul.appendChild(li);
+  }
+
+  if (ul.childNodes.length > 0) {
     this.popup.appendChild(ul);
   }
   else {
@@ -253,15 +255,12 @@
     removeClass(acdb.owner.input, 'throbbing');
     return alert('An HTTP error '+ xmlhttp.status +' occured.\n'+ acdb.uri);
   }
-  // Split into array of key->value pairs
-  var matches = string.length > 0 ? string.split('||') : [];
-  for (var i = 0; i < matches.length; i++) {
-    matches[i] = matches[i].length > 0 ? matches[i].split('|') : [];
-    // Decode textfield pipes back to plain-text
-    matches[i][0] = eregReplace('&#124;', '|', matches[i][0]);
+  // Parse back result
+  var matches = parseJson(string);
+  if (typeof matches['status'] == 'undefined' || matches['status'] != 0) {
+    acdb.cache[acdb.searchString] = matches;
+    acdb.owner.found(matches);    
   }
-  acdb.cache[acdb.searchString] = matches;
-  acdb.owner.found(matches);
 }
 
 /**
Index: modules/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy.module,v
retrieving revision 1.268
diff -u -r1.268 taxonomy.module
--- modules/taxonomy.module	26 Mar 2006 16:59:17 -0000	1.268
+++ modules/taxonomy.module	5 Apr 2006 12:00:32 -0000
@@ -1360,7 +1360,7 @@
       }
       $matches[$prefix . $n] = check_plain($tag->name);
     }
-    print drupal_implode_autocomplete($matches);
+    print drupal_to_js($matches);
     exit();
   }
 }
Index: modules/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user.module,v
retrieving revision 1.602
diff -u -r1.602 user.module
--- modules/user.module	28 Mar 2006 12:40:13 -0000	1.602
+++ modules/user.module	5 Apr 2006 12:00:39 -0000
@@ -2083,6 +2083,6 @@
   while ($user = db_fetch_object($result)) {
     $matches[$user->name] = check_plain($user->name);
   }
-  print drupal_implode_autocomplete($matches);
+  print drupal_to_js($matches);
   exit();
 }
