diff options
author | Mario <mario@mariovavti.com> | 2018-10-08 21:20:17 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-10-08 21:20:17 +0200 |
commit | 37b94bf5fa71835fe50af6f862e124e24b5db4b4 (patch) | |
tree | 012afad21875e324bd43051c843fef371c3ddd9d /Zotlabs/Lib/NativeWikiPage.php | |
parent | a00a849952eec8f7d7d480f8663446dc1fb7238c (diff) | |
parent | 709665846e66f093109730691b31d9e094d02088 (diff) | |
download | volse-hubzilla-37b94bf5fa71835fe50af6f862e124e24b5db4b4.tar.gz volse-hubzilla-37b94bf5fa71835fe50af6f862e124e24b5db4b4.tar.bz2 volse-hubzilla-37b94bf5fa71835fe50af6f862e124e24b5db4b4.zip |
Merge branch 'fix-wiki-escaping' into 'dev'
Fix wiki escaping (Regression tests needed)
See merge request hubzilla/core!1321
Diffstat (limited to 'Zotlabs/Lib/NativeWikiPage.php')
-rw-r--r-- | Zotlabs/Lib/NativeWikiPage.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php index d4875bbaf..ebdcb4740 100644 --- a/Zotlabs/Lib/NativeWikiPage.php +++ b/Zotlabs/Lib/NativeWikiPage.php @@ -44,7 +44,8 @@ class NativeWikiPage { $pages[] = [ 'resource_id' => $resource_id, 'title' => escape_tags($title), - 'url' => str_replace('%2F','/',urlencode(str_replace('%2F','/',urlencode($title)))), + //'url' => str_replace('%2F','/',urlencode(str_replace('%2F','/',urlencode($title)))), + 'url' => Zlib\NativeWiki::name_encode($title), 'link_id' => 'id_' . substr($resource_id, 0, 10) . '_' . $page_item['id'] ]; } @@ -98,7 +99,8 @@ class NativeWikiPage { $page = [ 'rawName' => $name, 'htmlName' => escape_tags($name), - 'urlName' => urlencode($name), + //'urlName' => urlencode($name), + 'urlName' => Zlib\NativeWiki::name_encode($name) ]; @@ -154,7 +156,8 @@ class NativeWikiPage { $page = [ 'rawName' => $pageNewName, 'htmlName' => escape_tags($pageNewName), - 'urlName' => urlencode(escape_tags($pageNewName)) + //'urlName' => urlencode(escape_tags($pageNewName)) + Zlib\NativeWiki::name_encode($pageNewName) ]; return [ 'success' => true, 'page' => $page ]; @@ -365,7 +368,6 @@ class NativeWikiPage { unset($item['id']); unset($item['author']); - $item['parent'] = 0; $item['body'] = $content; $item['author_xchan'] = $observer_hash; @@ -527,7 +529,8 @@ class NativeWikiPage { $pages = $pageURLs = array(); foreach ($match[1] as $m) { // TODO: Why do we need to double urlencode for this to work? - $pageURLs[] = urlencode(urlencode(escape_tags($m))); + //$pageURLs[] = urlencode(urlencode(escape_tags($m))); + $pageURLs[] = Zlib\NativeWiki::name_encode(escape_tags($m)); $pages[] = $m; } $idx = 0; |