aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-02-28 12:23:01 +0100
committerMario <mario@mariovavti.com>2020-02-28 12:23:01 +0100
commit84c9ae04fc2a9e05b74ad2427d8f78ebe3ab4d9a (patch)
tree412aa3e1fab3ed4ad62c55235418691d5945d932
parent7cf73e0533a61270c9bc5036c3da0e4ea4c593c5 (diff)
parentc74c41c3b88669802c96c565f04b2682a54d43e9 (diff)
downloadvolse-hubzilla-84c9ae04fc2a9e05b74ad2427d8f78ebe3ab4d9a.tar.gz
volse-hubzilla-84c9ae04fc2a9e05b74ad2427d8f78ebe3ab4d9a.tar.bz2
volse-hubzilla-84c9ae04fc2a9e05b74ad2427d8f78ebe3ab4d9a.zip
Merge branch 'wiki-link-titles' into 'dev'
Allow wiki link titles See merge request hubzilla/core!1842
-rw-r--r--Zotlabs/Lib/NativeWikiPage.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php
index dddd26af3..d84cc50a8 100644
--- a/Zotlabs/Lib/NativeWikiPage.php
+++ b/Zotlabs/Lib/NativeWikiPage.php
@@ -530,8 +530,11 @@ class NativeWikiPage {
foreach ($match[1] as $m) {
// TODO: Why do we need to double urlencode for this to work?
//$pageURLs[] = urlencode(urlencode(escape_tags($m)));
- $pageURLs[] = Zlib\NativeWiki::name_encode(escape_tags($m));
- $pages[] = $m;
+ $titleUri = explode('|',$m);
+ $page = $titleUri[0] ?? '';
+ $title = $titleUri[1] ?? $page;
+ $pageURLs[] = Zlib\NativeWiki::name_encode(escape_tags($page));
+ $pages[] = $title;
}
$idx = 0;
while(strpos($s,'[[') !== false) {