WordPress Twilight AutoSave cosmetic fix

There’s a bugette in TWA that leads to cosmetic display problem on Mozilla:

 

If the post is longer than 100 lines, the remainder should be replaced with ”

[...]

“, which is fine. However, if the post length is less than that, ”

undefined

” is instead displayed, which is confusing.

 

The patch required is:

 

<pre>--- tw-autosave.php.dist        2006-10-12 23:15:59.311223636 +0100
+++ tw-autosave.php     2006-10-12 23:14:02.828717161 +0100
@@ -90,5 +90,6 @@
                        var cookiedata = cookietemp.substring(0, 100);
+                       var endstring = "";
                        data = postdiv.innerHTML
                        if (cookietemp.length > 100){
-                               var endstring = "[...]";
+                               endstring = "[...]";
                        }</pre>