aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/dba/dba_pdo.php18
-rw-r--r--include/event.php11
2 files changed, 16 insertions, 13 deletions
diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php
index a70e4a1d7..0279342ec 100755
--- a/include/dba/dba_pdo.php
+++ b/include/dba/dba_pdo.php
@@ -161,23 +161,17 @@ class dba_pdo extends dba_driver {
}
function unescapebin($str) {
- if($this->driver_dbtype === 'pgsql' && (! is_null($str))) {
- $x = '';
- while(! feof($str)) {
- $x .= fread($str,8192);
+ if($this->driver_dbtype === 'pgsql') {
+ if(gettype($str) === 'resource') {
+ $str = stream_get_contents($str);
}
- if(substr($x,0,2) === '\\x') {
- $x = hex2bin(substr($x,2));
+ if(substr($str,0,2) === '\\x') {
+ $str = hex2bin(substr($str,2));
}
- return $x;
-
- }
- else {
- return $str;
}
+ return $str;
}
-
function getdriver() {
return 'pdo';
}
diff --git a/include/event.php b/include/event.php
index fdb9e1415..cfca00a3c 100644
--- a/include/event.php
+++ b/include/event.php
@@ -4,8 +4,11 @@
* @brief Event related functions.
*/
+
use Sabre\VObject;
+use Zotlabs\Lib\Activity;
+
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
@@ -65,7 +68,7 @@ function format_event_html($ev) {
}
function format_event_obj($jobject) {
- $event = array();
+ $event = [];
$object = json_decode($jobject,true);
@@ -1046,6 +1049,7 @@ function event_store_item($arr, $event) {
'location' => $arr['location'],
'adjust' => $arr['adjust'],
'content' => format_event_bbcode($arr),
+ 'attachment' => Activity::encode_attachment($r[0]),
'author' => array(
'name' => $r[0]['xchan_name'],
'address' => $r[0]['xchan_addr'],
@@ -1200,6 +1204,7 @@ function event_store_item($arr, $event) {
'location' => $arr['location'],
'adjust' => $arr['adjust'],
'content' => format_event_bbcode($arr),
+ 'attachment' => Activity::encode_attachment($item_arr),
'author' => array(
'name' => $x[0]['xchan_name'],
'address' => $x[0]['xchan_addr'],
@@ -1279,6 +1284,10 @@ function cdav_principal($uri) {
}
function cdav_perms($needle, $haystack, $check_rw = false) {
+
+ if($needle == 'channel_calendar')
+ return true;
+
foreach ($haystack as $item) {
if($check_rw) {
if(is_array($item['id'])) {