#388 pgsrc upgrade problem if mime wo/body

Installation
closed
5
2012-10-11
2004-10-11
Kai Krakow
No

The upgrade script accidently loads MIME files from the
pgsrc directory as plain text if they contain no body.

If this is a general problem of the import function in
ziplib.php (may or may not a MIME file contain no
body?) or in the export function of PhpWiki exceeds my
investigations.

In any case here's a inconsistency which should be
fixed. As some installations of PhpWiki may already
have exported pages without body, the import function
should be fixed to accept MIME data without bodies
(means no trailing lines after the headers, even no
empty line).

Discussion

  • Kai Krakow

    Kai Krakow - 2004-10-11

    Logged In: YES
    user_id=549222

    The following patch provides a quick fix to accept empty
    bodies with a missing trailing empty line after the headers:

    Index: lib/ziplib.php

    RCS file: /cvsroot/phpwiki/phpwiki/lib/ziplib.php,v
    retrieving revision 1.40
    diff -u -1 -b -p -r1.40 ziplib.php
    --- lib/ziplib.php 19 Jun 2004 12:32:37 -0000 1.40
    +++ lib/ziplib.php 11 Oct 2004 23:16:53 -0000
    @@ -626,2 +626,3 @@ function ParseRFC822Headers (&$string)

    • if (strlen($string) > 0)
      if (! preg_match("/^\r?\n/", $string, $match)) {
     

Log in to post a comment.