aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/attach.php1
-rw-r--r--include/chat.php8
-rw-r--r--include/config.php8
3 files changed, 10 insertions, 7 deletions
diff --git a/include/attach.php b/include/attach.php
index dbc489a2d..af1159957 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -26,6 +26,7 @@ function z_mime_content_type($filename) {
'xml' => 'application/xml',
'swf' => 'application/x-shockwave-flash',
'flv' => 'video/x-flv',
+ 'epub' => 'application/epub+zip',
// images
'png' => 'image/png',
diff --git a/include/chat.php b/include/chat.php
index 08fd154b5..5af3a3a9a 100644
--- a/include/chat.php
+++ b/include/chat.php
@@ -122,10 +122,10 @@ function chatroom_enter($observer_xchan,$room_id,$status,$client) {
intval($room_id)
);
if($r) {
- q("update chatpresence set cp_status = %d and cp_last = '%s' where cp_id = %d limit 1",
- dbesc($status),
+ q("update chatpresence set cp_last = '%s' where cp_id = %d and cp_client = '%s' limit 1",
dbesc(datetime_convert()),
- intval($r[0]['cp_id'])
+ intval($r[0]['cp_id']),
+ dbesc($client)
);
return true;
}
@@ -145,6 +145,7 @@ function chatroom_enter($observer_xchan,$room_id,$status,$client) {
function chatroom_leave($observer_xchan,$room_id,$client) {
if(! $room_id || ! $observer_xchan)
return;
+
$r = q("select * from chatpresence where cp_xchan = '%s' and cp_room = %d and cp_client = '%s' limit 1",
dbesc($observer_xchan),
intval($room_id),
@@ -155,6 +156,7 @@ function chatroom_leave($observer_xchan,$room_id,$client) {
intval($r[0]['cp_id'])
);
}
+
return true;
}
diff --git a/include/config.php b/include/config.php
index bccf0737f..8d98d56fa 100644
--- a/include/config.php
+++ b/include/config.php
@@ -65,7 +65,7 @@ function get_config($family, $key) {
if(! array_key_exists($key,$a->config[$family])) {
return false;
}
- return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$family][$key]))
+ return ((! is_array($a->config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$family][$key]))
? unserialize($a->config[$family][$key])
: $a->config[$family][$key]
);
@@ -174,8 +174,8 @@ function get_pconfig($uid,$family, $key, $instore = false) {
if((! array_key_exists($family,$a->config[$uid])) || (! array_key_exists($key,$a->config[$uid][$family])))
return false;
-
- return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$uid][$family][$key]))
+
+ return ((! is_array($a->config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$uid][$family][$key]))
? unserialize($a->config[$uid][$family][$key])
: $a->config[$uid][$family][$key]
);
@@ -304,7 +304,7 @@ function get_xconfig($xchan,$family, $key) {
if((! array_key_exists($family,$a->config[$xchan])) || (! array_key_exists($key,$a->config[$xchan][$family])))
return false;
- return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$xchan][$family][$key]))
+ return ((! is_array($a->config[$xchan][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$xchan][$family][$key]))
? unserialize($a->config[$xchan][$family][$key])
: $a->config[$xchan][$family][$key]
);