[pLog-svn] r890 - plog/trunk/js/ui

mark at devel.plogworld.net mark at devel.plogworld.net
Mon Jan 31 07:28:02 GMT 2005


Author: mark
Date: 2005-01-31 07:28:01 +0000 (Mon, 31 Jan 2005)
New Revision: 890

Modified:
   plog/trunk/js/ui/common.js
   plog/trunk/js/ui/plogui.js
Log:
Solve the bug http://bugs.plogworld.net/view.php?id=177 and http://bugs.plogworld.net/view.php?id=185.

Modified: plog/trunk/js/ui/common.js
===================================================================
--- plog/trunk/js/ui/common.js	2005-01-31 04:29:07 UTC (rev 889)
+++ plog/trunk/js/ui/common.js	2005-01-31 07:28:01 UTC (rev 890)
@@ -234,14 +234,14 @@
 				}
 			}
 			else if( itemName == "postText" && htmlAreaEnabled ) {
-				formData = formData + itemName + "=" + escape(postTextEditor.getHTML()) + "&";
+				formData = formData + itemName + "=" + encodeURIComponent(postTextEditor.getHTML()) + "&";
 			}
 			else if( itemName == "postExtendedText" && htmlAreaEnabled ) {
-				formData = formData + itemName + "=" + escape(postExtendedTextEditor.getHTML()) + "&";
+				formData = formData + itemName + "=" + encodeURIComponent(postExtendedTextEditor.getHTML()) + "&";
 			}
 			else {
 				// for all other elements, normal handling
-				formData = formData + itemName + "=" + escape(itemValue) + "&";		
+				formData = formData + itemName + "=" + encodeURIComponent(itemValue) + "&";		
 			}
 		}
     }	

Modified: plog/trunk/js/ui/plogui.js
===================================================================
--- plog/trunk/js/ui/plogui.js	2005-01-31 04:29:07 UTC (rev 889)
+++ plog/trunk/js/ui/plogui.js	2005-01-31 07:28:01 UTC (rev 890)
@@ -128,10 +128,17 @@
 		return false;
 	}
 	
-	if( form.postText.value == '' ) {
+    // Can't use form.postText.value, becasue the form.postText.value still "null"
+    if( htmlAreaEnabled ) {
+		postText = encodeURIComponent(postTextEditor.getHTML());
+	} else {
+		postText = form.postText.value
+    }
+    
+    if (postText == '') {
 		window.alert( msgErrorPostText );
 		return false;
-	}	
+	}
 	
 	if( !submitNewPost( form ))
 		return false;	




More information about the pLog-svn mailing list