Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#343 Plugin Upload: Problem with Filename containing spaces

Linking
closed
Reini Urban
5
2012-10-11
2004-06-09
Anonymous
No

Dear developers / users

No experience so far with PHPWiki but found a problem
with the UpLoad plugin. You are allowed to upload
files with space containing names like "wiki test",
but the Feature to link to this file via
"Upload:Filename" doesn't work because of the space.

The not experienced user may be confused.

May be its me who is unexperienced with PHPwiki to
solve this problem alternatively. Hence my disputable
proposal for /lib/plugin/UpLoad.php ist:
line 132 insert:
$userfile_name = str_replace(" ", "_", $userfile_name);

Best Regards

Discussion

  • Logged In: NO

    Problem occurred using phpwiki-1.3.10

     
  • Reini Urban
    Reini Urban
    2004-06-13

    Logged In: YES
    user_id=13755

    Thanks, fixed in current CVS.

    RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/UpLoad.php,v
    retrieving revision 1.11
    diff -u -b -r1.11 UpLoad.php
    --- plugin/UpLoad.php 11 Jun 2004 09:07:30 -0000 1.11
    +++ plugin/UpLoad.php 13 Jun 2004 11:31:53 -0000
    @@ -172,7 +175,7 @@
    $current =
    $pagehandle->getCurrentRevision();
    $version = $current->getVersion();
    $text = $current->getPackedContent();
    - $newtext = $text . "\n
    Upload:$userfile_name";
    + $newtext = $text . "\n

    [Upload:$userfile_name]";
    $meta = $current->data;
    $meta['summary'] =
    sprintf(
    ("uploaded %s"),$userfile_name);
    $pagehandle->save($newtext,
    $version + 1, $meta);