[Pmwiki-users] Re: Need help ($UploadUrlFmt)

Patrick R. Michaud pmichaud
Sun Jun 20 08:57:23 CDT 2004


On Sun, Jun 20, 2004 at 12:34:07PM -0700, Steven Leite wrote:
>    If I do this:
>        global $UploadUrlFmt
>    or this:
>        $UploadUrlFmt = FmtPageName('$UploadUrlFmt', $pagename);

This doesn't look right, since you're trying to define $UploadUrlFmt
in terms of itself.

Also, keep in mind that $UploadUrlFmt doesn't have a value set until
*after* upload.php has been loaded.  This is normally done by 
stdconfig.php, which occurs after any local customizations and 
cookbook scripts have been loaded.  If a cookbook script wants to 
use the values of the default upload script, it should explicitly do
include_once("$FarmD/scripts/upload.php") first.  (Note that this would
have the side-effect of enabling uploads even if someone has
$EnableUpload = 0, although it would still be password protected.)

>    I can fix it by doing this:
> 
>    $UploadUrlFmt  = preg_replace("#/[^/]*\$#", "/$UploadDir", $ScriptUrl,
>    1);

This is what upload.php does.

Pm



More information about the pmwiki-users mailing list