Update of /cvsroot/phpwiki/phpwiki/admin
In directory usw-pr-cvs1:/tmp/cvs-serv27829/admin
Modified Files:
Tag: release-1_2-branch
zip.php dumpserial.php
Log Message:
Fix SF bug #478449: (encoding of page names like '..')
Index: zip.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/admin/Attic/zip.php,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** zip.php 2001/02/08 18:28:31 1.1.2.1
--- zip.php 2001/11/06 20:41:24 1.1.2.2
***************
*** 1,4 ****
--- 1,11 ----
<?php // $Id$
+ function encode_pagename_for_wikizip ($pagename) {
+ $enc = rawurlencode($pagename);
+ // URL encode leading dot:
+ $enc = preg_replace('/^\./', '%2e', $enc);
+ return $enc;
+ }
+
function MailifyPage ($pagehash, $oldpagehash = false)
{
***************
*** 8,12 ****
$head = "From $from " . ctime(time()) . "\r\n";
! $head .= "Subject: " . rawurlencode($pagehash['pagename']) . "\r\n";
$head .= "From: $from (PhpWiki)\r\n";
$head .= "Date: " . rfc1123date($pagehash['lastmodified']) . "\r\n";
--- 15,19 ----
$head = "From $from " . ctime(time()) . "\r\n";
! $head .= "Subject: " . encode_pagename_for_wikizip($pagehash['pagename']) . "\r\n";
$head .= "From: $from (PhpWiki)\r\n";
$head .= "Date: " . rfc1123date($pagehash['lastmodified']) . "\r\n";
***************
*** 44,47 ****
--- 51,55 ----
for (reset($pages); $pagename = current($pages); next($pages))
{
+
set_time_limit(30); // Reset watchdog.
$pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
***************
*** 62,70 ****
$content = MailifyPage($pagehash, $oldpagehash);
! $zip->addRegularFile( rawurlencode($pagehash['pagename']),
$content, $attrib);
}
$zip->finish();
}
if(defined('WIKI_ADMIN'))
--- 70,79 ----
$content = MailifyPage($pagehash, $oldpagehash);
! $zip->addRegularFile( encode_pagename_for_wikizip($pagehash['pagename']),
$content, $attrib);
}
$zip->finish();
}
+
if(defined('WIKI_ADMIN'))
Index: dumpserial.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/admin/Attic/dumpserial.php,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** dumpserial.php 2001/02/14 06:32:19 1.1.2.1
--- dumpserial.php 2001/11/06 20:41:24 1.1.2.2
***************
*** 25,29 ****
for ($x = 0; $x < $numpages; $x++) {
$pagename = htmlspecialchars($pages[$x]);
! $filename = rawurlencode($pages[$x]);
$html .= "<br>$pagename ... ";
if($pagename != $filename)
--- 25,29 ----
for ($x = 0; $x < $numpages; $x++) {
$pagename = htmlspecialchars($pages[$x]);
! $filename = preg_replace('/^\./', '%2e', rawurlencode($pages[$x]));
$html .= "<br>$pagename ... ";
if($pagename != $filename)
|