diff options
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Mail.php | 16 | ||||
-rw-r--r-- | Zotlabs/Module/Wiki.php | 13 |
2 files changed, 24 insertions, 5 deletions
diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php index 459ce5acf..2fb89fed5 100644 --- a/Zotlabs/Module/Mail.php +++ b/Zotlabs/Module/Mail.php @@ -296,7 +296,9 @@ class Mail extends \Zotlabs\Web\Controller { return $o; } - + + $direct_mid = 0; + switch(argv(1)) { case 'combined': $mailbox = 'combined'; @@ -309,12 +311,22 @@ class Mail extends \Zotlabs\Web\Controller { break; default: $mailbox = 'combined'; + + // notifications direct to mail/nn + + if(intval(argv(1))) + $direct_mid = intval(argv(1)); break; } + $last_message = private_messages_list(local_channel(), $mailbox, 0, 1); - + $mid = ((argc() > 2) && (intval(argv(2)))) ? argv(2) : $last_message[0]['id']; + + if($direct_mid) + $mid = $direct_mid; + $plaintext = true; diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 9adef1795..a1e377e68 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -236,11 +236,10 @@ class Wiki extends \Zotlabs\Web\Controller { $mimeType = $p['mimeType']; - $rawContent = htmlspecialchars_decode(json_decode($p['content']),ENT_COMPAT); + $sampleContent = (($mimeType == 'text/bbcode') ? '[h3]' . t('New page') . '[/h3]' : '### ' . t('New page')); - $rawContent = $p['content']; + $content = (($p['content'] == '') ? $sampleContent : $p['content']); - $content = ($p['content'] !== '' ? $rawContent : '"# New page\n"'); // Render the Markdown-formatted page content in HTML if($mimeType == 'text/bbcode') { $renderedContent = Zlib\NativeWikiPage::convert_links(zidify_links(smilies(bbcode($content))), argv(0) . '/' . argv(1) . '/' . $wikiUrlName); @@ -364,6 +363,14 @@ class Wiki extends \Zotlabs\Web\Controller { if($wiki['urlName'] === '') { notice( t('Error creating wiki. Invalid name.') . EOL); goaway('/wiki'); + return; //not reached + } + + $exists = Zlib\NativeWiki::exists_by_name($owner['channel_id'], $wiki['urlName']); + if($exists['id']) { + notice( t('A wiki with this name already exists.') . EOL); + goaway('/wiki'); + return; //not reached } // Get ACL for permissions |