[patch] mod_http_upload_external: replace PHP_SELF with DOCUMENT_URI

26 views
Skip to first unread message

Vladimir Nikishkin

unread,
Sep 17, 2021, 12:13:30 AM9/17/21
to proso...@googlegroups.com
Dear Prosody Developers,

I suggest this tiny patch for inclusion into the
mod_http_upload_external

Motivation:
`share.php` belives PHP_SELF to be the full URI given to the uploaded
file. However, for example, using nginx, with certain configurations
this is not the case, as can be seen, say, here:
https://code.r3pek.org/r3pek/docker-prosody-http-upload-external/src/branch/master/default.conf

The user has to modify share.php, and provide a separate UPLOAD_FILENAME
header.

This tweak could be avoided using DOCUMENT_URI.
I checked with nginx, and OpenBSD's https, and it seems to work without
problems.

The patch is attached to this mesage:

001-http_mod_upload_external-DOCUMENT_URI.patch

Matthew Wild

unread,
Sep 17, 2021, 2:16:51 AM9/17/21
to Prosody IM Developers Group
Hi, thanks for the patch!

On Fri, 17 Sept 2021 at 05:13, Vladimir Nikishkin <lock...@gmail.com> wrote:
This tweak could be avoided using DOCUMENT_URI.
I checked with nginx, and OpenBSD's https, and it seems to work without
problems.

Can you confirm whether this also works on Apache servers? I know many people (myself included) use it with Apache and I'd like to not break that, but when I tested back when I originally wrote the script there were limited variables available for this.

Regards,
Matthew

Christian Weiske

unread,
Sep 17, 2021, 2:19:29 AM9/17/21
to proso...@googlegroups.com
Hi,


> Can you confirm whether this also works on Apache servers? I know many
> people (myself included) use it with Apache and I'd like to not break
> that, but when I tested back when I originally wrote the script there
> were limited variables available for this.

My local apache server with mod_php 8 does not have this variable at all:

> Notice: Undefined index: DOCUMENT_URI in test.php on line 3

--
Regards/Mit freundlichen Grüßen
Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-
Reply all
Reply to author
Forward
0 new messages