aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/NativeWikiPage.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-01-26 15:16:41 -0800
committerzotlabs <mike@macgirvin.com>2017-01-26 15:16:41 -0800
commit22839e48d013abdc46b609cd50b45b3bce6626f9 (patch)
treeb36a061ac82ce7aa4d99871ec228f53c841631f4 /Zotlabs/Lib/NativeWikiPage.php
parentf7f39cf6c00d914efb1f2624d7a885ac912512e9 (diff)
downloadvolse-hubzilla-22839e48d013abdc46b609cd50b45b3bce6626f9.tar.gz
volse-hubzilla-22839e48d013abdc46b609cd50b45b3bce6626f9.tar.bz2
volse-hubzilla-22839e48d013abdc46b609cd50b45b3bce6626f9.zip
better handling of html special chars in wiki and wikipage names
Diffstat (limited to 'Zotlabs/Lib/NativeWikiPage.php')
-rw-r--r--Zotlabs/Lib/NativeWikiPage.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php
index 9fbab791b..1467a1cfb 100644
--- a/Zotlabs/Lib/NativeWikiPage.php
+++ b/Zotlabs/Lib/NativeWikiPage.php
@@ -32,8 +32,8 @@ class NativeWikiPage {
if(urldecode($title) !== 'Home') {
$pages[] = [
'resource_id' => $resource_id,
- 'title' => urldecode($title),
- 'url' => $title,
+ 'title' => escape_tags($title),
+ 'url' => urlencode(urlencode($title)),
'link_id' => 'id_' . substr($resource_id, 0, 10) . '_' . $page_item['id']
];
}
@@ -59,7 +59,7 @@ class NativeWikiPage {
// We may wish to change this some day.
$arr['item_unpublished'] = 1;
- set_iconfig($arr,'nwikipage','pagetitle',urlencode(($name) ? $name : t('(No Title)')),true);
+ set_iconfig($arr,'nwikipage','pagetitle',(($name) ? $name : t('(No Title)')),true);
$p = post_activity_item($arr, false, false);
@@ -67,11 +67,11 @@ class NativeWikiPage {
$page = [
'rawName' => $name,
'htmlName' => escape_tags($name),
- 'urlName' => urlencode(escape_tags($name)),
- 'fileName' => urlencode(escape_tags($name)) . Zlib\NativeWikiPage::get_file_ext($w)
+ 'urlName' => urlencode($name),
+
];
- return array('page' => $page, 'item_id' => $p['item_id'], 'wiki' => $w, 'message' => '', 'success' => true);
+ return array('page' => $page, 'item_id' => $p['item_id'], 'item' => $p['activity'], 'wiki' => $w, 'message' => '', 'success' => true);
}
return [ 'success' => false, 'message' => t('Wiki page create failed.') ];
}
@@ -134,6 +134,7 @@ class NativeWikiPage {
$channel_id = ((array_key_exists('channel_id',$arr)) ? intval($arr['channel_id']) : 0);
$revision = ((array_key_exists('revision',$arr)) ? intval($arr['revision']) : (-1));
+
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (! $w['wiki']) {
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);