From: Lo?c C. <lo...@us...> - 2001-04-08 21:18:57
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv17637/chat Modified Files: input.php3 handle_input.php3 Log Message: Improve the way multiple submission are avoided Index: input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/input.php3,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** input.php3 2001/04/08 18:24:04 1.4 --- input.php3 2001/04/08 21:18:54 1.5 *************** *** 133,145 **** checkColor($color); // Remove swearings if (C_BAD_WORDS) { include('./lib/swearing.lib.' . C_EXTENSION); ! $message = checkwords($message, false); } // Format original message and set enhanced one (with graphical smilies) - $strictMessage = $message; $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; --- 133,147 ---- checkColor($color); + // Store the strict original message + $strictMessage = $message; + // Remove swearings if (C_BAD_WORDS) { include('./lib/swearing.lib.' . C_EXTENSION); ! $message = checkWords($message, false); } // Format original message and set enhanced one (with graphical smilies) $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; *************** *** 174,178 **** $dbLink->query($msgQuery); ! $doRefreshMessages = true; } // end of handle 'true' messages --- 176,183 ---- $dbLink->query($msgQuery); ! // Restore the strict original message and set some variables ! $message = $strictMessage; ! unset($strictMessage); ! $doRefreshMessages = true; } // end of handle 'true' messages *************** *** 430,434 **** // Display a JavaScript alert box with the error message if necessary window.parent.pmcSetMsgBoxFocus(); ! alert('<?php echo(str_replace('\\\\n', '\\n', pmcSlashSingleQuotes($error))); ?>'); // --> </script> --- 435,439 ---- // Display a JavaScript alert box with the error message if necessary window.parent.pmcSetMsgBoxFocus(); ! alert('<?php echo(pmcSlashSingleQuotes($error)); ?>'); // --> </script> Index: handle_input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/handle_input.php3,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** handle_input.php3 2001/04/08 18:24:04 1.3 --- handle_input.php3 2001/04/08 21:18:54 1.4 *************** *** 134,150 **** checkColor($color); // Remove swearings if (C_BAD_WORDS) { include('./lib/swearing.lib.' . C_EXTENSION); ! $message = checkwords($message, false); } // Format original message and set enhanced one (with graphical smilies) - $strictMessage = $message; $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; - $message = $strictMessage; - unset($strictMessage); if (C_USE_SMILIES) { --- 134,150 ---- checkColor($color); + // Store the strict original message + $strictMessage = $message; + // Remove swearings if (C_BAD_WORDS) { include('./lib/swearing.lib.' . C_EXTENSION); ! $message = checkWords($message, false); } // Format original message and set enhanced one (with graphical smilies) $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; if (C_USE_SMILIES) { *************** *** 174,178 **** $dbLink->query($msgQuery); ! $doRefreshMessages = true; } // end of handle 'true' messages --- 174,182 ---- $dbLink->query($msgQuery); ! ! // Restore the strict original message and set some variables ! $message = $strictMessage; ! unset($strictMessage); ! $doRefreshMessages = true; } // end of handle 'true' messages *************** *** 263,267 **** // Display a JavaScript alert box with the error message if necessary window.parent.pmcSetMsgBoxFocus(); ! alert('<?php echo(str_replace('\\\\n', '\\n', pmcSlashSingleQuotes($error))); ?>'); <?php } --- 267,271 ---- // Display a JavaScript alert box with the error message if necessary window.parent.pmcSetMsgBoxFocus(); ! alert('<?php echo(pmcSlashSingleQuotes($error)); ?>'); <?php } |