wiki mimetype selection. We can add text/plain as soon as we add code to purify and render it specifically.

This commit is contained in:
zotlabs
2017-09-12 23:15:30 -07:00
parent 7489a4442e
commit 796228b7ad
5 changed files with 32 additions and 12 deletions

View File

@@ -59,7 +59,7 @@ class NativeWikiPage {
logger('mimetype: ' . $mimetype);
if(! in_array($mimetype,[ 'text/markdown','text/bbcode','text/plain','text/html']))
if(! in_array($mimetype,[ 'text/markdown','text/bbcode','text/plain','text/html' ]))
$mimetype = 'text/markdown';
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
@@ -173,10 +173,11 @@ class NativeWikiPage {
$content = $item['body'];
return [
'content' => $content,
'mimeType' => $w['mimeType'],
'message' => '',
'success' => true
'content' => $content,
'mimeType' => $w['mimeType'],
'pageMimeType' => $item['mimetype'],
'message' => '',
'success' => true
];
}
@@ -339,7 +340,6 @@ class NativeWikiPage {
return array('message' => t('Error reading wiki'), 'success' => false);
}
$mimetype = $w['mimeType'];
// fetch the most recently saved revision.
@@ -348,6 +348,8 @@ class NativeWikiPage {
return array('message' => t('Page not found'), 'success' => false);
}
$mimetype = $item['mimetype'];
// change just the fields we need to change to create a revision;
unset($item['id']);