aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Wiki.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-11-29 10:33:46 +0100
committerMario Vavti <mario@mariovavti.com>2016-11-29 10:33:46 +0100
commitd184b3fa8674a349b274b69655b8e8c38dab064b (patch)
tree50b4319d010de68e24f2af60d5ab320426e0635a /Zotlabs/Module/Wiki.php
parent91e97468a096474afe0444135f789293f74c422c (diff)
downloadvolse-hubzilla-d184b3fa8674a349b274b69655b8e8c38dab064b.tar.gz
volse-hubzilla-d184b3fa8674a349b274b69655b8e8c38dab064b.tar.bz2
volse-hubzilla-d184b3fa8674a349b274b69655b8e8c38dab064b.zip
more work on wiki mimetypes
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r--Zotlabs/Module/Wiki.php9
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']) {