diff options
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Wiki.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index d43b71f92..edd783a62 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -313,7 +313,6 @@ class Wiki extends \Zotlabs\Web\Controller { if (local_channel() !== intval($owner['channel_id'])) { goaway('/' . argv(0) . '/' . $nick . '/'); } - $wiki = array(); // Generate new wiki info from input name $wiki['postVisible'] = ((intval($_POST['postVisible']) === 0) ? 0 : 1); @@ -321,10 +320,12 @@ class Wiki extends \Zotlabs\Web\Controller { $wiki['htmlName'] = escape_tags($_POST['wikiName']); $wiki['urlName'] = urlencode($_POST['wikiName']); $wiki['mimeType'] = $_POST['mimeType']; + if($wiki['urlName'] === '') { notice( t('Error creating wiki. Invalid name.') . EOL); goaway('/wiki'); } + // Get ACL for permissions $acl = new \Zotlabs\Access\AccessList($owner); $acl->set_from_array($_POST); @@ -386,7 +387,7 @@ class Wiki extends \Zotlabs\Web\Controller { 'commit_msg' => t('New page created'), 'resource_id' => $resource_id, 'observer' => $ob, - 'files' => array($page['page']['urlName'].'.md') + 'files' => array($page['page']['fileName']) )); if($commit['success']) { json_return_and_die(array('url' => '/'.argv(0).'/'.argv(1).'/'.$page['wiki']['urlName'].'/'.$page['page']['urlName'], 'success' => true)); @@ -442,7 +443,7 @@ class Wiki extends \Zotlabs\Web\Controller { 'commit_msg' => $commitMsg, 'resource_id' => $resource_id, 'observer' => $ob, - 'files' => array($pageUrlName.'.md') + 'files' => array($saved['fileName']) )); if($commit['success']) { json_return_and_die(array('message' => 'Wiki git repo commit made', 'success' => true)); @@ -581,7 +582,7 @@ class Wiki extends \Zotlabs\Web\Controller { 'commit_msg' => 'Renamed ' . urldecode($pageUrlName) . ' to ' . $renamed['page']['htmlName'], 'resource_id' => $resource_id, 'observer' => $ob, - 'files' => array($pageUrlName . '.md', $renamed['page']['fileName']), + 'files' => array($pageUrlName . substr($renamed['page']['fileName'], -3), $renamed['page']['fileName']), 'all' => true )); if($commit['success']) { |