aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Wiki.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 6055b0b38..2668229ee 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -140,11 +140,16 @@ class Wiki extends \Zotlabs\Web\Controller {
$zip = new \ZipArchive;
$r = $zip->open($zip_filepath, \ZipArchive::CREATE);
if($r === true) {
- $i = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s'",
+ $pages = [];
+ $i = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' order by revision desc",
dbesc($resource_id)
);
+
if($i) {
foreach($i as $iv) {
+ if(in_array($iv['mid'],$pages))
+ continue;
+
if($iv['mimetype'] === 'text/plain') {
$content = html_entity_decode($iv['body'],ENT_COMPAT,'UTF-8');
}
@@ -156,6 +161,7 @@ class Wiki extends \Zotlabs\Web\Controller {
}
$fname = get_iconfig($iv['id'],'nwikipage','pagetitle') . Zlib\NativeWikiPage::get_file_ext($iv);
$zip->addFromString($fname,$content);
+ $pages[] = $iv['mid'];
}