Using 7.x-1.x branch, I had to fix a syntax error in chatroom.php, the || is in the wrong place.

Index: chatblock.php                                                                                                                       
===================================================================                                                                        
--- chatblock.php       (revision 5778)                                                                                                    
+++ chatblock.php       (working copy)                                                                                                     
@@ -38,8 +38,8 @@ if (                                                                                                                     
    * manipulated.                                                                                                                         
    */                                                                                                                                     
                                                                                                                                           
+  preg_match('#(^[\\/]|\.+[\\/]*|:|[\\/]{2,})#', $_POST['mp'])                                                                            
   ||                                                                                                                                      
-  preg_match('#(^[\\/]|\.+[\\/]*|:|[\\/]{2,})#', $_POST['mp'])                                                                            
                                                                                                                                           
   // Overflow protection.                                                                                                                 
          

Even with the fix, the javascript is broken. I get the same message over and over in the console "TypeError: data is null" at if (data.ok), line 233.

When a user types their own message, they see it. No-one else does until they refresh the page.

Comments

Dave Cohen’s picture

Turns out, that preg_match returns true, and that makes chatblock.php fail. I have no idea what that preg_match is trying to accomplish, I had to comment it out.

Index: chatblock.php
===================================================================
--- chatblock.php       (revision 5778)
+++ chatblock.php       (working copy)
@@ -38,8 +38,9 @@ if (
    * manipulated.
    */

-  ||
-  preg_match('#(^[\\/]|\.+[\\/]*|:|[\\/]{2,})#', $_POST['mp'])
+  // Patch by Dave, I have no idea what this about, but it returns true when it shouldn't.
+  //preg_match('#(^[\\/]|\.+[\\/]*|:|[\\/]{2,})#', $_POST['mp'])
+  //||

   // Overflow protection.

@@ -52,8 +53,9 @@ if (

   // Session name is alwas 36 byte in D6 (md5 + "SESS").
   // @todo: Probably overblocking? Losen?
+  // Patched by Dave, md5 + "SSESS" = 37 for secure sessions.
   ||
-  strlen($_POST['session']) != 36
+  (strlen($_POST['session']) != 36 && strlen($_POST['session']) != 37)
 ) {
   exit;
 }

doitDave’s picture

Status: Active » Postponed (maintainer needs more info)

preg_match in that line wants to avoid path requests with some problematic patterns. Can you provide the path from your network log that fails with this logic? I would rather analyze them instead of disabling this check. Thx

Dave Cohen’s picture

That was a long time ago. Not sure how I reproduced it. I think I gave up on chatblock.

doitDave’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

OK, no problem. Thanks anyway for you concern :)