diff --git a/package-info.xml b/package-info.xml
index b518ccb..8d36fb4 100644
--- a/package-info.xml
+++ b/package-info.xml
@@ -4,9 +4,9 @@
SMF Shoutbox
Deep:SMF_Shoutbox
modification
- 1.16
+ 1.17
-
+
@@ -21,12 +21,12 @@
Originally written By Deep (diem4@gmx.net), inspired by Matthew Wolf (a.k.a Grudge)
Heavily improved by Markus Birth (mbirth@webwriters.de)
- Copyright 2006 - Neither this package or any of it's contents may be distributed without authorisation.
+ Copyright 2006-2008 - Neither this package or any of it's contents may be distributed without authorisation.
]]>
sbox_latest.xml
-
+
@@ -42,7 +42,7 @@ PLEASE UNINSTALL ANY LANGUAGE PACK FOR SHOUTBOX BEFORE UPGRADING!]]>
sbox_upgrade.php
sbox_latest.xml
-
+
@@ -58,7 +58,7 @@ PLEASE UNINSTALL ANY LANGUAGE PACK FOR SHOUTBOX BEFORE UPGRADING!]]>
sbox_upgrade.php
sbox_latest.xml
-
+
@@ -74,7 +74,7 @@ PLEASE UNINSTALL ANY LANGUAGE PACK FOR SHOUTBOX BEFORE UPGRADING!]]>
sbox_upgrade.php
sbox_latest.xml
-
+
@@ -90,7 +90,7 @@ PLEASE UNINSTALL ANY LANGUAGE PACK FOR SHOUTBOX BEFORE UPGRADING!]]>
sbox_upgrade.php
sbox_latest.xml
-
+
@@ -98,12 +98,12 @@ PLEASE UNINSTALL ANY LANGUAGE PACK FOR SHOUTBOX BEFORE UPGRADING!]]>
-
+
-
+
Uninstall will remove all the changes made by the shoutbox.
sbox_latest.xml
diff --git a/sboxDB.php b/sboxDB.php
index e402f46..9345eac 100644
--- a/sboxDB.php
+++ b/sboxDB.php
@@ -8,8 +8,12 @@ require("../SSI.php");
if (!defined('SMF'))
die('Hacking attempt...');
+loadLanguage('Errors');
loadLanguage('sbox');
+if ($context['user']['is_guest'] && $modSettings['sbox_GuestVisible'] != '1')
+ die($txt[1] . ' ' . $txt['sbox_Login']);
+
/***[ BEGIN CONFIGURATION ]***************************************************/
$sbox_HistoryFile = $boarddir . '/sbox.history.html';
@@ -27,14 +31,14 @@ $sbox_DateSuffix = ']';
// BEGIN: BORROWED FROM http://de2.php.net/manual/en/function.flock.php
/*
- * I hope this is usefull.
- * If mkdir() is atomic,
+ * I hope this is usefull.
+ * If mkdir() is atomic,
* then we do not need to worry about race conditions while trying to make the lockDir,
* unless of course we're writing to NFS, for which this function will be useless.
* so thats why i pulled out the usleep(rand()) piece from the last version
*
* Again, its important to tailor some of the parameters to ones indivdual usage
- * I set the default $timeLimit to 3/10th's of a second (maximum time allowed to achieve a lock),
+ * I set the default $timeLimit to 3/10th's of a second (maximum time allowed to achieve a lock),
* but if you're writing some extrememly large files, and/or your server is very slow, you may need to increase it.
* Obviously, the $staleAge of the lock directory will be important to consider as well if the writing operations might take a while.
* My defaults are extrememly general and you're encouraged to set your own
@@ -86,14 +90,15 @@ function missinghtmlentities($text) {
global $context;
// entitify missing characters, ignore entities already there (Unicode / UTF8) (hopefully in {-notation)
$split = preg_split('/([\d]+;)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
+ // filter out "ANSI_X3.4-1968" charset, which just means plain old ASCII ... replace by UTF-8
+ if (strpos($context['character_set'], 'ANSI_') !== false) $charset = 'UTF-8'; else $charset = $context['character_set'];
$result = '';
foreach ($split as $s) {
- if (substr($s, 0, 2) != '' || substr($s, -1, 1) != ';') {
- // filter out "ANSI_X3.4-1968" charset, which just means plain old ASCII ... replace by UTF-8
- if (strpos($context['character_set'], 'ANSI_') !== false) $charset = 'UTF-8'; else $charset = $context['character_set'];
- $result .= @htmlentities($s, ENT_NOQUOTES, $charset);
+ if (substr($s, 0, 2) == '' || substr($s, -1, 1) == ';') {
+ // Convert to std character and htmlentity-fy it again - to re-convert e.g. c; to < so that XSS isn't possible
+ $result .= @htmlentities(@html_entity_decode($s, ENT_NOQUOTES, $charset), ENT_NOQUOTES, $charset);
} else {
- $result .= $s;
+ $result .= @htmlentities($s, ENT_NOQUOTES, $charset);
}
}
return $result;
@@ -103,7 +108,7 @@ function missinghtmlentities($text) {
echo '
';
-
+
$result = db_query("SELECT time FROM {$db_prefix}sbox_content ORDER BY time DESC LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
$refreshBlocked = false;
@@ -136,7 +141,7 @@ echo '
}
// ]]>