Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv2701
Modified Files:
loadsave.php ziplib.php
Log Message:
Cleaned up binary pagedump hack a bit (importing binary pagedumps created by this hack actually works now). Added new global $pagedump_format to index.php for specifying "quoted-printable" or "binary" pagedumps.
Index: loadsave.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/loadsave.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** loadsave.php 2002/01/09 03:00:41 1.20
--- loadsave.php 2002/01/09 04:01:09 1.21
***************
*** 29,42 ****
function MailifyPage ($page, $nversions = 1)
{
! global $SERVER_ADMIN;
$current = $page->getCurrentRevision();
$from = isset($SERVER_ADMIN) ? $SERVER_ADMIN : 'foo@bar';
!
! $head = "From $from " . CTime(time()) . "\r\n";
! $head .= "Subject: " . rawurlencode($page->getName()) . "\r\n";
! $head .= "From: $from (PhpWiki)\r\n";
! $head .= "Date: " . Rfc2822DateTime($current->get('mtime')) . "\r\n";
! $head .= sprintf("Mime-Version: 1.0 (Produced by PhpWiki %s)\r\n", PHPWIKI_VERSION);
$head .= "X-RCS_ID: $" ."Id" ."$" ."\r\n";
--- 29,46 ----
function MailifyPage ($page, $nversions = 1)
{
! global $SERVER_ADMIN, $pagedump_format;
$current = $page->getCurrentRevision();
$from = isset($SERVER_ADMIN) ? $SERVER_ADMIN : 'foo@bar';
! $head = "";
! if ($pagedump_format == 'quoted-printable') {
! $head = "From $from " . CTime(time()) . "\r\n";
! $head .= "Subject: " . rawurlencode($page->getName()) . "\r\n";
! $head .= "From: $from (PhpWiki)\r\n";
! $head .= "Date: " . Rfc2822DateTime($current->get('mtime')) . "\r\n";
! $head .= sprintf("Mime-Version: 1.0 (Produced by PhpWiki %s)\r\n", PHPWIKI_VERSION);
! } else {
! $head .= sprintf("Mime-Version: 1.0 (Produced by PhpWiki %s)\r\n", PHPWIKI_VERSION."+carsten's-binary-hack");
! }
$head .= "X-RCS_ID: $" ."Id" ."$" ."\r\n";
Index: ziplib.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/ziplib.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** ziplib.php 2002/01/09 02:50:14 1.14
--- ziplib.php 2002/01/09 04:01:09 1.15
***************
*** 493,498 ****
function MimeifyPageRevision ($revision) {
// This is a dirty hack to allow saving binary text files. See below.
! $cte = "quoted-printable";
! //$cte = "binary";
$page = $revision->getPage();
// FIXME: add 'hits' to $params
--- 493,497 ----
function MimeifyPageRevision ($revision) {
// This is a dirty hack to allow saving binary text files. See below.
! global $pagedump_format;
$page = $revision->getPage();
// FIXME: add 'hits' to $params
***************
*** 511,520 ****
$out = MimeContentTypeHeader('application', 'x-phpwiki', $params);
! $out .= "Content-Transfer-Encoding: " .$cte ."\r\n";
$out .= "\r\n";
foreach ($revision->getContent() as $line) {
// This is a dirty hack to allow saving binary text files. See above.
! $out .= ($cte == "quoted-printable") ? QuotedPrintableEncode(chop($line)) : chop($line);
$out .= "\r\n";
}
--- 510,519 ----
$out = MimeContentTypeHeader('application', 'x-phpwiki', $params);
! $out .= "Content-Transfer-Encoding: " .$pagedump_format ."\r\n";
$out .= "\r\n";
foreach ($revision->getContent() as $line) {
// This is a dirty hack to allow saving binary text files. See above.
! $out .= ($pagedump_format == "quoted-printable") ? QuotedPrintableEncode(chop($line)) : chop($line);
$out .= "\r\n";
}
|