diff options
-rw-r--r-- | Zotlabs/Lib/NativeWiki.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/NativeWikiPage.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Wiki.php | 6 | ||||
-rw-r--r-- | view/tpl/wiki.tpl | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/Zotlabs/Lib/NativeWiki.php b/Zotlabs/Lib/NativeWiki.php index 65f40748c..cdabbc3e9 100644 --- a/Zotlabs/Lib/NativeWiki.php +++ b/Zotlabs/Lib/NativeWiki.php @@ -252,7 +252,7 @@ class NativeWiki { AND item_deleted = 0 $sql_extra limit 1", dbesc(NWIKI_ITEM_RESOURCE_TYPE), //dbesc(urldecode($urlName)), - dbesc($urlName), + dbesc(self::name_decode($urlName)), intval($uid) ); diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php index ebdcb4740..8d21fac5e 100644 --- a/Zotlabs/Lib/NativeWikiPage.php +++ b/Zotlabs/Lib/NativeWikiPage.php @@ -157,7 +157,7 @@ class NativeWikiPage { 'rawName' => $pageNewName, 'htmlName' => escape_tags($pageNewName), //'urlName' => urlencode(escape_tags($pageNewName)) - Zlib\NativeWiki::name_encode($pageNewName) + 'urlName' => Zlib\NativeWiki::name_encode($pageNewName) ]; return [ 'success' => true, 'page' => $page ]; diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index ead7eea6a..25823da62 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -293,9 +293,9 @@ class Wiki extends Controller { } //$wikiheaderName = urldecode($wikiUrlName); - $wikiheaderName = $wikiUrlName; + $wikiheaderName = NativeWiki::name_decode($wikiUrlName); //$wikiheaderPage = urldecode($pageUrlName); - $wikiheaderPage = $pageUrlName; + $wikiheaderPage = NativeWiki::name_decode($pageUrlName); $renamePage = (($wikiheaderPage === 'Home') ? '' : t('Rename page')); $sharePage = t('Share'); @@ -812,7 +812,7 @@ class Wiki extends Controller { if ($pageUrlName === 'Home') { json_return_and_die(array('message' => 'Cannot rename Home','success' => false)); } - if(NativeWiki::encode_name(escape_tags($pageNewName)) === '') { + if(NativeWiki::name_encode(escape_tags($pageNewName)) === '') { json_return_and_die(array('message' => 'Error renaming page. Invalid name.', 'success' => false)); } // Determine if observer has permission to rename pages diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 0f6fad8e3..979f38903 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -98,8 +98,8 @@ <script> window.wiki_resource_id = '{{$resource_id}}'; - window.wiki_page_name = '{{$page}}'; - window.wiki_page_content = '{{$content|escape:'javascript'}}'; + window.wiki_page_name = '{{$page|escape:"javascript"}}'; + window.wiki_page_content = '{{$content|escape:"javascript"}}'; window.wiki_page_commit = '{{$commit}}'; window.saved = true; @@ -122,7 +122,7 @@ if (data.success) { $('#rename-page-form-wrapper').hide(); window.console.log('data: ' + JSON.stringify(data)); - window.wiki_page_name = data.name.urlName; + window.wiki_page_name = data.name.htmlName; $('#wiki-header-page').html(data.name.htmlName); wiki_refresh_page_list(); } else { |