diff options
-rw-r--r-- | Zotlabs/Daemon/Cron.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Ap_probe.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Mail.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Pubstream.php | 4 | ||||
-rw-r--r-- | include/bbcode.php | 2 | ||||
-rw-r--r-- | include/conversation.php | 6 | ||||
-rw-r--r-- | include/markdown.php | 7 | ||||
-rw-r--r-- | include/zot.php | 4 | ||||
-rw-r--r-- | view/tpl/cdav_widget_addressbook.tpl | 1 | ||||
-rwxr-xr-x | view/tpl/msg-header.tpl | 53 | ||||
-rwxr-xr-x | view/tpl/prv_message.tpl | 1 |
13 files changed, 45 insertions, 47 deletions
diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index c84708ba4..65edbedfa 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -174,7 +174,8 @@ class Cron { // pull in some public posts - if(! get_config('system','disable_discover_tab')) + $disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false; + if(! $disable_discover_tab) Master::Summon(array('Externals')); $generation = 0; diff --git a/Zotlabs/Module/Ap_probe.php b/Zotlabs/Module/Ap_probe.php index f788fa73a..769cd4c4e 100644 --- a/Zotlabs/Module/Ap_probe.php +++ b/Zotlabs/Module/Ap_probe.php @@ -30,7 +30,7 @@ class Ap_probe extends \Zotlabs\Web\Controller { $redirects = 0; $x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]); if($x['success']) - $o .= '<pre>' . str_replace('\\','',jindent($x['body'])) . '</pre>'; + $o .= '<pre>' . str_replace(['\\n','\\'],["\n",''],jindent($x['body'])) . '</pre>'; } return $o; } diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 9e64528fa..5e7a3fbc0 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -634,7 +634,7 @@ class Item extends \Zotlabs\Web\Controller { $attach_link = ''; $hash = substr($mtch,0,strpos($mtch,',')); $rev = intval(substr($mtch,strpos($mtch,','))); - $r = attach_by_hash_nodata($hash,$rev); + $r = attach_by_hash_nodata($hash, $observer['xchan_hash'], $rev); if($r['success']) { $attachments[] = array( 'href' => z_root() . '/attach/' . $r['data']['hash'], diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php index 7e6ec0cf9..e5509961a 100644 --- a/Zotlabs/Module/Mail.php +++ b/Zotlabs/Module/Mail.php @@ -53,8 +53,8 @@ class Mail extends \Zotlabs\Web\Controller { } $body = trim(str_replace($match[1],'',$body)); } - echo json_encode(['preview' => zidify_links(smilies(bbcode($body)))]); } + echo json_encode(['preview' => zidify_links(smilies(bbcode($body)))]); } killme(); } diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 45623c7b0..e5c059af5 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -409,8 +409,9 @@ class Network extends \Zotlabs\Web\Controller { } $abook_uids = " and abook.abook_channel = " . local_channel() . " "; - - if($firehose && (! get_config('system','disable_discover_tab'))) { + + $disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false; + if($firehose && (! $disable_discover_tab)) { require_once('include/channel.php'); $sys = get_sys_channel(); $uids = " and item.uid = " . intval($sys['channel_id']) . " "; diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 28c34425c..42aa2b51b 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -16,8 +16,8 @@ class Pubstream extends \Zotlabs\Web\Controller { return login(); } - - if(get_config('system','disable_discover_tab')) + $disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false; + if($disable_discover_tab) return; $item_normal = item_normal(); diff --git a/include/bbcode.php b/include/bbcode.php index c408af35d..9f9b5c5e1 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -7,7 +7,7 @@ require_once('include/oembed.php'); require_once('include/event.php'); require_once('include/zot.php'); - +require_once('include/html2plain.php'); function get_bb_tag_pos($s, $name, $occurance = 1) { diff --git a/include/conversation.php b/include/conversation.php index 1c1a4479d..ec887fc6c 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1622,11 +1622,9 @@ function network_tabs() { // tabs $tabs = array(); - $d = get_config('system','disable_discover_tab'); - if($d === false) - $d = 1; + $disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false; - if(! $d) { + if(! $disable_discover_tab) { $tabs[] = array( 'label' => t('Discover'), 'url' => z_root() . '/' . $cmd . '?f=&fh=1' , diff --git a/include/markdown.php b/include/markdown.php index 530af57a0..0cd9ab237 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -157,11 +157,11 @@ function bb_to_markdown($Text, $options = []) { * Transform #tags, strip off the [url] and replace spaces with underscore */ - $Text = preg_replace_callback('/#\[([zu])rl\=(\w+.*?)\](\w+.*?)\[\/[(zu)]rl\]/i', + $Text = preg_replace_callback('/#\[([zu])rl\=(.*?)\](.*?)\[\/[(zu)]rl\]/i', create_function('$match', 'return \'#\'. str_replace(\' \', \'_\', $match[3]);'), $Text); - $Text = preg_replace('/#\^\[([zu])rl\=(\w+.*?)\](\w+.*?)\[\/([zu])rl\]/i', '[$1rl=$2]$3[/$4rl]', $Text); + $Text = preg_replace('/#\^\[([zu])rl\=(.*?)\](.*?)\[\/([zu])rl\]/i', '[$1rl=$2]$3[/$4rl]', $Text); // Converting images with size parameters to simple images. Markdown doesn't know it. $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $Text); @@ -197,9 +197,6 @@ function bb_to_markdown($Text, $options = []) { // Remove empty zrl links $Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text); - // escape all unconverted tags - $Text = escape_tags($Text); - $Text = trim($Text); call_hooks('bb_to_markdown', $Text); diff --git a/include/zot.php b/include/zot.php index 8bbc4a969..4d056ffeb 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1326,8 +1326,10 @@ function public_recips($msg) { $include_sys = false; if($msg['message']['type'] === 'activity') { - if(! get_config('system','disable_discover_tab')) + $disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false; + if(! $disable_discover_tab) $include_sys = true; + $perm = 'send_stream'; if(array_key_exists('flags',$msg['message']) && in_array('thread_parent', $msg['message']['flags'])) { diff --git a/view/tpl/cdav_widget_addressbook.tpl b/view/tpl/cdav_widget_addressbook.tpl index c875dc977..80b5feaf6 100644 --- a/view/tpl/cdav_widget_addressbook.tpl +++ b/view/tpl/cdav_widget_addressbook.tpl @@ -47,6 +47,7 @@ </li> <div id="upload-form" class="sub-menu-wrapper"> <div class="sub-menu"> + <form enctype="multipart/form-data" method="post" action=""> <div class="form-group"> <select id="import" name="target" class="form-control"> <option value="">{{$import_placeholder}}</option> diff --git a/view/tpl/msg-header.tpl b/view/tpl/msg-header.tpl index 013e1cfdc..0e8fb0389 100755 --- a/view/tpl/msg-header.tpl +++ b/view/tpl/msg-header.tpl @@ -1,34 +1,31 @@ -<script type="text/javascript" src="view/js/ajaxupload.js" ></script> -<script language="javascript" type="text/javascript"> - - $("#prvmail-text").editor_autocomplete(baseurl+"/acl"); - - +<script src="library/blueimp_upload/js/vendor/jquery.ui.widget.js"></script> +<script src="library/blueimp_upload/js/jquery.iframe-transport.js"></script> +<script src="library/blueimp_upload/js/jquery.fileupload.js"></script> +<script> $(document).ready(function() { - var file_uploader = new window.AjaxUpload( - 'prvmail-attach-wrapper', - { action: 'wall_attach/{{$nickname}}', - name: 'userfile', - onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); }, - onComplete: function(file,response) { - addmailtext(response); - $('#prvmail-rotator').spin(false); - } - } - ); + $("#prvmail-text").editor_autocomplete(baseurl+"/acl"); + + $('#invisible-wall-file-upload').fileupload({ + url: 'wall_attach/{{$nickname}}', + dataType: 'json', + dropZone: $('#prvmail-text'), + maxChunkSize: 4 * 1024 * 1024, + add: function(e,data) { + $('#prvmail-rotator').spin('tiny'); + data.submit(); + }, + done: function(e,data) { + addmailtext(data.result.message); + $('#jot-media').val($('#jot-media').val() + data.result.message); + }, + stop: function(e,data) { + $('#prvmail-rotator').spin(false); + }, + }); - var file_uploader_sub = new window.AjaxUpload( - 'prvmail-attach-sub', - { action: 'wall_attach/{{$nickname}}', - name: 'userfile', - onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); }, - onComplete: function(file,response) { - addmailtext(response); - $('#prvmail-rotator').spin(false); - } - } - ); + $('#prvmail-attach-wrapper').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;}); + $('#prvmail-attach-wrapper-sub').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;}); }); diff --git a/view/tpl/prv_message.tpl b/view/tpl/prv_message.tpl index 925447ff2..af6315c7e 100755 --- a/view/tpl/prv_message.tpl +++ b/view/tpl/prv_message.tpl @@ -6,6 +6,7 @@ <div class="section-content-wrapper"> {{/if}} <div id="prvmail-wrapper" > + <input id="invisible-wall-file-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50;left:-50;width:0;height:0;" multiple> <form id="prvmail-form" action="mail" method="post" > <input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" /> <input type="hidden" name="media_str" id="jot-media" value="" /> |