Update of /cvsroot/phpwiki/phpwiki/admin
In directory usw-pr-cvs1:/tmp/cvs-serv4426/admin
Modified Files:
Tag: release-1_2-branch
zip.php
Log Message:
Propagate bug fixes from MAIN CVS branch into the stable release branch.
I have not added Arno's new transform.php code.
Should we? (Is it functionally equivalent to the old code?)
Index: zip.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/admin/zip.php,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -r1.1 -r1.1.2.1
*** zip.php 2000/11/08 15:30:16 1.1
--- zip.php 2001/02/08 18:28:31 1.1.2.1
***************
*** 1,5 ****
<?php // $Id$
! function MailifyPage ($pagehash, $archive = false)
{
global $SERVER_ADMIN, $ArchivePageStore;
--- 1,5 ----
<?php // $Id$
! function MailifyPage ($pagehash, $oldpagehash = false)
{
global $SERVER_ADMIN, $ArchivePageStore;
***************
*** 13,23 ****
$head .= "Mime-Version: 1.0 (Produced by PhpWiki 1.1.x)\r\n";
! if ($archive)
{
! $oldpage = RetrievePage($archive, $pagehash['pagename'], $ArchivePageStore);
! if (is_array($oldpage))
! return $head . MimeMultipart(array(MimeifyPage($oldpage),
! MimeifyPage($pagehash)));
}
return $head . MimeifyPage($pagehash);
}
--- 13,22 ----
$head .= "Mime-Version: 1.0 (Produced by PhpWiki 1.1.x)\r\n";
! if (is_array($oldpagehash))
{
! return $head . MimeMultipart(array(MimeifyPage($oldpagehash),
! MimeifyPage($pagehash)));
}
+
return $head . MimeifyPage($pagehash);
}
***************
*** 38,42 ****
if ($include_archive) {
- $dba = OpenDataBase($ArchivePageStore);
$zipname = "wikidb.zip";
}
--- 37,40 ----
***************
*** 48,53 ****
--- 46,58 ----
set_time_limit(30); // Reset watchdog.
$pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
+
if (! is_array($pagehash))
continue;
+
+ if ($include_archive)
+ $oldpagehash = RetrievePage($dbi, $pagename, $ArchivePageStore);
+ else
+ $oldpagehash = false;
+
$attrib = array('mtime' => $pagehash['lastmodified'],
'is_ascii' => 1);
***************
*** 55,59 ****
$attrib['write_protected'] = 1;
! $content = MailifyPage($pagehash, $dba);
$zip->addRegularFile( rawurlencode($pagehash['pagename']),
--- 60,64 ----
$attrib['write_protected'] = 1;
! $content = MailifyPage($pagehash, $oldpagehash);
$zip->addRegularFile( rawurlencode($pagehash['pagename']),
***************
*** 61,67 ****
}
$zip->finish();
-
- if ($dba)
- CloseDataBase($dba);
}
--- 66,69 ----
|