aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Wiki.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-30 16:10:59 -0700
committerzotlabs <mike@macgirvin.com>2017-03-30 16:10:59 -0700
commita9cceea8500bfb74aed21af9631b43188dd3ce29 (patch)
tree2165131d83b86f38c4b30b0dc4c7ccb70b70c4b0 /Zotlabs/Module/Wiki.php
parentb51ca4c8d3a36ed49582c4fe894944869b0d42a2 (diff)
parentdea487993828d00e7be9709752129e445a255171 (diff)
downloadvolse-hubzilla-a9cceea8500bfb74aed21af9631b43188dd3ce29.tar.gz
volse-hubzilla-a9cceea8500bfb74aed21af9631b43188dd3ce29.tar.bz2
volse-hubzilla-a9cceea8500bfb74aed21af9631b43188dd3ce29.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r--Zotlabs/Module/Wiki.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 1d166cb57..d577226dc 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);
@@ -365,6 +364,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