diff options
author | zotlabs <mike@macgirvin.com> | 2017-09-16 15:48:48 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-09-16 15:48:48 -0700 |
commit | e84281b620650db8f066f2643c1f9089a88e088d (patch) | |
tree | c92da3e6f46457b454d3000fbf18641b2b0a336c /Zotlabs/Module/Wiki.php | |
parent | cb3fb0049f64a92668bc94746dc55cc905683699 (diff) | |
download | volse-hubzilla-e84281b620650db8f066f2643c1f9089a88e088d.tar.gz volse-hubzilla-e84281b620650db8f066f2643c1f9089a88e088d.tar.bz2 volse-hubzilla-e84281b620650db8f066f2643c1f9089a88e088d.zip |
wiki download: only include the latest page revision
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r-- | Zotlabs/Module/Wiki.php | 8 |
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']; } |