From: Lo?c C. <lo...@us...> - 2001-04-04 23:50:58
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv23307 Modified Files: input.php3 handle_input.php3 Log Message: Take into account that db links may be used by commands Index: input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/input.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** input.php3 2001/04/03 20:10:15 1.1 --- input.php3 2001/04/04 23:50:54 1.2 *************** *** 115,118 **** --- 115,119 ---- if (isset($message) && trim($message) != '') { + $dbLink = new pmcDB; include('./lib/format_messages.lib.' . C_EXTENSION); *************** *** 120,124 **** if (substr($message, 0, 1) == '/') { ! include('./lib/commands.lib' . C_EXTENSION); if (!($isCommand) && !isset($error)) $error = L_BAD_CMD; --- 121,125 ---- if (substr($message, 0, 1) == '/') { ! include('./lib/commands.lib.' . C_EXTENSION); if (!($isCommand) && !isset($error)) $error = L_BAD_CMD; *************** *** 143,147 **** $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; ! unset($message); if (C_USE_SMILIES) { --- 144,149 ---- $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; ! $message = $strictMessage; ! unset($strictMessage); if (C_USE_SMILIES) { *************** *** 170,179 **** . ')'; - $dbLink = new pmcDB; $dbLink->query($msgQuery); - $dbLink->close(); $doRefreshMessages = true; } // end of handle 'true' messages } // end of handle submitted message --- 172,181 ---- . ')'; $dbLink->query($msgQuery); $doRefreshMessages = true; } // end of handle 'true' messages + + $dbLink->close(); } // end of handle submitted message *************** *** 234,238 **** <!-- Last sent message or command (used for the '/!' command) --> ! <input type="hidden" name="prevMessage" value="<?php echo(isset($strictMessage) ? htmlspecialchars(stripslashes($strictMessage)) : ''); ?>" /> <!-- Addressee that will be filled when the user click on a nick at the users frame --> --- 236,240 ---- <!-- Last sent message or command (used for the '/!' command) --> ! <input type="hidden" name="prevMessage" value="<?php echo(isset($message) ? htmlspecialchars(stripslashes($message)) : ''); ?>" /> <!-- Addressee that will be filled when the user click on a nick at the users frame --> *************** *** 255,259 **** $msgValue = ($displayMessage) ? htmlspecialchars($prevMessage) : ''; if (isset($error) && !($isCommand)) ! $msgValue = htmlspecialchars($strictMessage); ?> <!-- Message box --> --- 257,261 ---- $msgValue = ($displayMessage) ? htmlspecialchars($prevMessage) : ''; if (isset($error) && !($isCommand)) ! $msgValue = htmlspecialchars($message); ?> <!-- Message box --> Index: handle_input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/handle_input.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** handle_input.php3 2001/04/03 20:10:15 1.1 --- handle_input.php3 2001/04/04 23:50:54 1.2 *************** *** 116,119 **** --- 116,120 ---- if (isset($message) && trim($message) != '') { + $dbLink = new pmcDB; include('./lib/format_messages.lib.' . C_EXTENSION); *************** *** 121,125 **** if (substr($message, 0, 1) == '/') { ! include('./lib/commands.lib' . C_EXTENSION); if (!($isCommand) && !isset($error)) $error = L_BAD_CMD; --- 122,126 ---- if (substr($message, 0, 1) == '/') { ! include('./lib/commands.lib.' . C_EXTENSION); if (!($isCommand) && !isset($error)) $error = L_BAD_CMD; *************** *** 144,148 **** $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; ! unset($message); if (C_USE_SMILIES) { --- 145,150 ---- $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; ! $message = $strictMessage; ! unset($strictMessage); if (C_USE_SMILIES) { *************** *** 170,180 **** . '\'' . pmcSlashSingleQuotes($enhancedMessage) . '\'' . ')'; - - $dbLink = new pmcDB; $dbLink->query($msgQuery); - $dbLink->close(); $doRefreshMessages = true; } // end of handle 'true' messages } // end of handle submitted message --- 172,181 ---- . '\'' . pmcSlashSingleQuotes($enhancedMessage) . '\'' . ')'; $dbLink->query($msgQuery); $doRefreshMessages = true; } // end of handle 'true' messages + + $dbLink->close(); } // end of handle submitted message *************** *** 203,207 **** with (window.parent.frames['input'].window.document.forms['inputForm']) { ! elements['prevMessage'].value = '<?php echo(isset($strictMessage) ? pmcSlashSingleQuotes(htmlspecialchars($strictMessage)) : ''); ?>'; <?php --- 204,208 ---- with (window.parent.frames['input'].window.document.forms['inputForm']) { ! elements['prevMessage'].value = '<?php echo(isset($message) ? pmcSlashSingleQuotes(htmlspecialchars($message)) : ''); ?>'; <?php *************** *** 212,216 **** $msgValue = ($displayMessage) ? htmlspecialchars($prevMessage) : ''; if (isset($error) && !($isCommand)) ! $msgValue = pmcSlashSingleQuotes(htmlspecialchars($strictMessage)); ?> elements['message'].value = '<?php echo($msgValue); ?>'; --- 213,217 ---- $msgValue = ($displayMessage) ? htmlspecialchars($prevMessage) : ''; if (isset($error) && !($isCommand)) ! $msgValue = pmcSlashSingleQuotes(htmlspecialchars($message)); ?> elements['message'].value = '<?php echo($msgValue); ?>'; |