aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/api_zot.php2
-rw-r--r--include/attach.php32
-rw-r--r--include/bb2diaspora.php2
-rw-r--r--include/import.php2
-rw-r--r--include/message.php2
-rwxr-xr-xinclude/oembed.php12
6 files changed, 27 insertions, 25 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index e91d82b0b..38919cb95 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -83,7 +83,7 @@
$ptr['content'] = '';
elseif(! intval($r[0]['os_storage'])) {
$ptr['start'] = $start;
- $x = substr(dbunescbin($ptr['content'],$start,$length));
+ $x = substr(dbunescbin($ptr['content']),$start,$length);
$ptr['length'] = strlen($x);
$ptr['content'] = base64_encode($x);
}
diff --git a/include/attach.php b/include/attach.php
index 4e8b3c056..e2e214ce3 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -704,6 +704,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
// not yet used
$os_path = '';
+ $display_path = '';
if($src)
@file_put_contents($os_basepath . $os_relpath,@file_get_contents($src));
@@ -719,7 +720,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$edited = $created;
if($options === 'replace') {
- $r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', filesize = %d, os_storage = %d, is_photo = %d, content = '%s', edited = '%s', os_path = '%s' where id = %d and uid = %d",
+ $r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', filesize = %d, os_storage = %d, is_photo = %d, content = '%s', edited = '%s', os_path = '%s', display_path = '%s' where id = %d and uid = %d",
dbesc($filename),
dbesc($mimetype),
dbesc($folder_hash),
@@ -729,13 +730,14 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
dbesc($os_basepath . $os_relpath),
dbesc($created),
dbesc($os_path),
+ dbesc($display_path),
intval($existing_id),
intval($channel_id)
);
}
elseif($options === 'revise') {
- $r = q("insert into attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, content, created, edited, os_path, allow_cid, allow_gid, deny_cid, deny_gid )
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
+ $r = q("insert into attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, content, created, edited, os_path, display_path, allow_cid, allow_gid, deny_cid, deny_gid )
+ VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($x[0]['aid']),
intval($channel_id),
dbesc($x[0]['hash']),
@@ -751,6 +753,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
dbesc($created),
dbesc($created),
dbesc($os_path),
+ dbesc($display_path),
dbesc($x[0]['allow_cid']),
dbesc($x[0]['allow_gid']),
dbesc($x[0]['deny_cid']),
@@ -758,8 +761,8 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
);
}
elseif($options === 'update') {
- $r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', edited = '%s', os_storage = %d, is_photo = %d, os_path = '%s',
- allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where id = %d and uid = %d",
+ $r = q("update attach set filename = '%s', filetype = '%s', folder = '%s', edited = '%s', os_storage = %d, is_photo = %d, os_path = '%s',
+ display_path = '%s', allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where id = %d and uid = %d",
dbesc((array_key_exists('filename',$arr)) ? $arr['filename'] : $x[0]['filename']),
dbesc((array_key_exists('filetype',$arr)) ? $arr['filetype'] : $x[0]['filetype']),
dbesc(($folder_hash) ? $folder_hash : $x[0]['folder']),
@@ -767,6 +770,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
dbesc((array_key_exists('os_storage',$arr)) ? $arr['os_storage'] : $x[0]['os_storage']),
dbesc((array_key_exists('is_photo',$arr)) ? $arr['is_photo'] : $x[0]['is_photo']),
dbesc((array_key_exists('os_path',$arr)) ? $arr['os_path'] : $x[0]['os_path']),
+ dbesc((array_key_exists('display_path',$arr)) ? $arr['display_path'] : $x[0]['display_path']),
dbesc((array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $x[0]['allow_cid']),
dbesc((array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : $x[0]['allow_gid']),
dbesc((array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : $x[0]['deny_cid']),
@@ -776,8 +780,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
);
}
else {
- $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, content, created, edited, os_path, allow_cid, allow_gid,deny_cid, deny_gid )
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
+
+ $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, folder, filesize, revision, os_storage, is_photo, content, created, edited, os_path, display_path, allow_cid, allow_gid,deny_cid, deny_gid )
+ VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($channel['channel_account_id']),
intval($channel_id),
dbesc($hash),
@@ -793,6 +798,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
dbesc($created),
dbesc($created),
dbesc($os_path),
+ dbesc($display_path),
dbesc(($arr && array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $str_contact_allow),
dbesc(($arr && array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : $str_group_allow),
dbesc(($arr && array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : $str_contact_deny),
@@ -1037,8 +1043,12 @@ function attach_mkdir($channel, $observer_hash, $arr = null) {
$created = datetime_convert();
- $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, filesize, revision, folder, os_storage, is_dir, content, created, edited, allow_cid, allow_gid, deny_cid, deny_gid )
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
+ // not yet used
+ $os_path = '';
+ $display_path = '';
+
+ $r = q("INSERT INTO attach ( aid, uid, hash, creator, filename, filetype, filesize, revision, folder, os_storage, is_dir, content, created, edited, os_path, display_path, allow_cid, allow_gid, deny_cid, deny_gid )
+ VALUES ( %d, %d, '%s', '%s', '%s', '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($channel['channel_account_id']),
intval($channel_id),
dbesc($arr['hash']),
@@ -1053,6 +1063,8 @@ function attach_mkdir($channel, $observer_hash, $arr = null) {
dbesc($path),
dbesc($created),
dbesc($created),
+ dbesc($os_path),
+ dbesc($display_path),
dbesc(($arr && array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $channel['channel_allow_cid']),
dbesc(($arr && array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : $channel['channel_allow_gid']),
dbesc(($arr && array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : $channel['channel_deny_cid']),
@@ -2233,4 +2245,4 @@ function attach_folder_rpaths($all_folders,$that_folder) {
}
return (($error) ? false : [ $current_hash , $path ]);
-} \ No newline at end of file
+}
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 14d5b4eef..514b2b339 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -321,7 +321,7 @@ function bb2diaspora_itemwallwall(&$item,$uplink = false) {
}
-function bb2diaspora_itembody($item, $force_update = false, $have_channel = false, $uplink) {
+function bb2diaspora_itembody($item, $force_update = false, $have_channel = false, $uplink = false) {
if(! get_iconfig($item,'diaspora','fields')) {
diff --git a/include/import.php b/include/import.php
index d5f6e5c8a..49cdb2574 100644
--- a/include/import.php
+++ b/include/import.php
@@ -860,7 +860,7 @@ function import_conv($channel,$convs) {
if($channel && $convs) {
foreach($convs as $conv) {
if($conv['deleted']) {
- q("delete from conv where guid = '%s' and uid = %d limit 1",
+ q("delete from conv where guid = '%s' and uid = %d",
dbesc($conv['guid']),
intval($channel['channel_id'])
);
diff --git a/include/message.php b/include/message.php
index 25986092d..f5821490d 100644
--- a/include/message.php
+++ b/include/message.php
@@ -436,7 +436,7 @@ function private_messages_drop($channel_id, $messageitem_id, $drop_conversation
intval($channel_id)
);
if($z) {
- q("delete from conv where guid = '%s' and uid = %d limit 1",
+ q("delete from conv where guid = '%s' and uid = %d",
dbesc($x[0]['conv_guid']),
intval($channel_id)
);
diff --git a/include/oembed.php b/include/oembed.php
index 1780e7046..52fb04058 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -137,10 +137,6 @@ function oembed_fetch_url($embedurl){
if($action !== 'block') {
$txt = Zlib\Cache::get('[' . App::$videowidth . '] ' . $embedurl);
-
- if(strstr($txt,'youtu') && strstr(z_root(),'https:')) {
- $txt = str_replace('http:','https:',$txt);
- }
}
if(is_null($txt)) {
@@ -272,13 +268,7 @@ function oembed_format_object($j){
$th=120; $tw = $th*$tr;
$tpl=get_markup_template('oembed_video.tpl');
- if(strstr($embedurl,'youtu') && strstr(z_root(),'https:')) {
- $embedurl = str_replace('http:','https:',$embedurl);
- $j['thumbnail_url'] = str_replace('http:','https:', $j['thumbnail_url']);
- $jhtml = str_replace('http:','https:', $jhtml);
- $j['html'] = str_replace('http:','https:', $j['html']);
-
- }
+
$ret.=replace_macros($tpl, array(
'$baseurl' => z_root(),
'$embedurl'=>$embedurl,