diff --git a/irc.php b/irc.php
index 073e5e4..5e30a22 100755
--- a/irc.php
+++ b/irc.php
@@ -128,7 +128,7 @@ while($bytes = socket_recv($socket, $r_data, 2048, MSG_DONTWAIT) !== '') {
$nickMsg = explode('NICK', $data);
$msgline = "
$senderNick $senderIp | $senderNick is now known as" . $nickMsg[1] . " |
\n";
file_put_contents("$username.log", $socketFileContents . $msgline);
- } else if ($ex[2] == $username && (count(explode(":", $stringMsg[1])) > 1)) {
+ } else if ($ex[2] == $username && (count(explode(":", $stringMsg[1])) > 2)) {
$senderNick = get_string_between($data, ":", "!");
$senderIp = get_string_between($data, "@", " ");
$privMsg = explode(":", $stringMsg[1]);
@@ -139,7 +139,7 @@ while($bytes = socket_recv($socket, $r_data, 2048, MSG_DONTWAIT) !== '') {
$msg .= $msgchunk;
}
- $msgline = "PM from: $senderNick $senderIp | " . stripslashes(trim($msg)) . " |
\n";
+ $msgline = "PM from: $senderNick $senderIp | " . htmlentities(stripslashes(trim($msg))) . " |
\n";
file_put_contents("$username.log", $socketFileContents . $msgline);
$msg = "";
} else if ($stringMsg[1] != "") {
@@ -147,7 +147,7 @@ while($bytes = socket_recv($socket, $r_data, 2048, MSG_DONTWAIT) !== '') {
$senderIp = get_string_between($data, "@", " ");
$channel = explode(" :", $stringMsg[1]);
$msg = explode($channel[0] . " :", $stringMsg[1]);
- $msgline = "$senderNick:" . $channel[0] . " $senderIp | " . stripslashes(trim($msg[1])) . " |
\n";
+ $msgline = "$senderNick:" . $channel[0] . " $senderIp | " . htmlentities(stripslashes(trim($msg[1]))) . " |
\n";
file_put_contents("$username.log", $socketFileContents . $msgline);
} else if ($ex[0] != "PING") {
$msgline = "" . $server_address . " ~ | " . $data . " |
\n";
diff --git a/server.php b/server.php
index cb66d6b..e821dc0 100755
--- a/server.php
+++ b/server.php
@@ -86,8 +86,10 @@ if (isset($_GET['msg']) && $_GET['msg']!="" && isset($_GET['nick']) && $_GET['ni
if($cmd[1]!="") {
doLog("$username: listing users for " . $cmd[1]);
$line .= "NAMES " . trim($cmd[1]) . "\n"; // set for push
- //$logline .= "$nick: | Joining " . $cmd[1] . " |
\n"; // push to client
- }
+ } else {
+ doLog("$username: listing users for $channel");
+ $line .= "NAMES $channel\n"; // set for push
+ }
} else if ($cmd[0] == "/rejoin") {
doLog("$username: rejoining channel");
if ($cmd[1] != "") {