Fixed search indexer causing duplicate keys when two "words" of 64+ characters encountered and first 64 characters are the same (thanks Vadi); attempt to fix onunload confirmation during page editing
authorDan
Thu, 27 Dec 2007 11:35:00 -0500
changeset 339 5d62ef764b0d
parent 338 915d399dfdbf
child 340 993fb077944f
child 440 105457df35e5
Fixed search indexer causing duplicate keys when two "words" of 64+ characters encountered and first 64 characters are the same (thanks Vadi); attempt to fix onunload confirmation during page editing
includes/clientside/static/misc.js
includes/search.php
--- a/includes/clientside/static/misc.js	Sun Dec 23 17:58:21 2007 -0500
+++ b/includes/clientside/static/misc.js	Thu Dec 27 11:35:00 2007 -0500
@@ -125,7 +125,8 @@
   if(typeof message != 'string') message = 'You may want to save your changes first.';
   var body = document.getElementsByTagName('body');
   body = body[0];
-  body.onbeforeunload='return unescape(\''+escape(message)+'\')';
+  body._unloadmsg = message;
+  body.onbeforeunload = function() { return this._unloadmsg };
 }
 
 function enableUnload()
@@ -133,6 +134,7 @@
   var body = document.getElementsByTagName('body');
   body = body[0];
   body.onbeforeunload = null;
+  body._unloadmsg = null;
 }
 
 /**
--- a/includes/search.php	Sun Dec 23 17:58:21 2007 -0500
+++ b/includes/search.php	Thu Dec 27 11:35:00 2007 -0500
@@ -75,7 +75,7 @@
       $words = explode(' ', $letters);
       foreach($words as $c => $w)
       {
-        if(strlen($w) < 2 || in_array($w, $stopwords))
+        if(strlen($w) < 2 || in_array($w, $stopwords) || strlen($w) > 63)
           unset($words[$c]);
         else
           $words[$c] = $w;