diff options
author | M.Dent <dentm42@dm42.net> | 2018-10-07 23:08:47 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-10-10 11:04:58 +0200 |
commit | bf878dc4461ea28f71055d59496b21a1685ef63e (patch) | |
tree | 7a7abb400df5c2c167cbb24d9c15fd3d0d7e156a /Zotlabs/Lib/NativeWikiPage.php | |
parent | d1270aab4d2c6bbc300eac489253fc9683a8a848 (diff) | |
download | volse-hubzilla-bf878dc4461ea28f71055d59496b21a1685ef63e.tar.gz volse-hubzilla-bf878dc4461ea28f71055d59496b21a1685ef63e.tar.bz2 volse-hubzilla-bf878dc4461ea28f71055d59496b21a1685ef63e.zip |
Implement custom escaping
(cherry picked from commit 93a310582f044d35f0a3583671053595fefdbedb)
Diffstat (limited to 'Zotlabs/Lib/NativeWikiPage.php')
-rw-r--r-- | Zotlabs/Lib/NativeWikiPage.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php index d4875bbaf..d0f522ec1 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), + 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 ]; @@ -527,7 +530,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; |