aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Wiki.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-27 20:37:37 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-27 20:37:37 -0400
commitca78ebce6d254f244b4c1fbe25eb3aca40b26952 (patch)
tree87f2f1a3dabf9d28d36a5210547e88a9328851fa /Zotlabs/Module/Wiki.php
parent97e6b7c4ba1938a46ea18d3ef96eba2d6246dab0 (diff)
downloadvolse-hubzilla-ca78ebce6d254f244b4c1fbe25eb3aca40b26952.tar.gz
volse-hubzilla-ca78ebce6d254f244b4c1fbe25eb3aca40b26952.tar.bz2
volse-hubzilla-ca78ebce6d254f244b4c1fbe25eb3aca40b26952.zip
Check if wiki exists and redirect if it does not
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r--Zotlabs/Module/Wiki.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 221068e0a..290c2e005 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -26,6 +26,7 @@ class Wiki extends \Zotlabs\Web\Controller {
}
function get() {
+ require_once('include/wiki.php');
require_once('include/acl_selectors.php');
if(local_channel()) {
$channel = \App::get_channel();
@@ -56,6 +57,10 @@ class Wiki extends \Zotlabs\Web\Controller {
} elseif (argc()<4) {
$wikiheader = 'Empty wiki: ' . rawurldecode(argv(2)); // show wiki name
$hide_editor = true;
+ // Check if wiki exists andr redirect if it does not
+ if(!wiki_exists_by_name(argv(2))['id']) {
+ goaway('/'.argv(0).'/'.argv(1));
+ }
} elseif (argc()<5) {
$wikiheader = rawurldecode(argv(2)) . ': ' . rawurldecode(argv(3)); // show wiki name and page
$hide_editor = false;
@@ -112,7 +117,7 @@ class Wiki extends \Zotlabs\Web\Controller {
// then, use webpage permissions
if (!$perms['write_pages']) {
notice(t('Permission denied.') . EOL);
- goaway(argv(0).'/'.argv(1).'/'.argv(2));
+ goaway('/'.argv(0).'/'.argv(1).'/'.argv(2));
}
}
$name = escape_tags(urlencode($_POST['wikiName'])); //Get new wiki name