Heyuri / Uploader

2ちゃん uploader!
MIT License
2 stars 0 forks source link

Upload fails if anti flood module is loaded #9

Closed kaguy4 closed 5 months ago

kaguy4 commented 5 months ago

I get this in error log: 2024/04/22 17:58:07 [error] 18751#18751: *33927993 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: upfile in /data/nakura/writable/g.php on line 72PHP message: PHP Notice: Trying to access array offset on value of type null in /data/nakura/writable/g.php on line 72PHP message: PHP Notice: Undefined index: upfile in /data/nakura/writable/g.php on line 73PHP message: PHP Notice: Trying to access array offset on value of type null in /data/nakura/writable/g.php on line 73PHP message: PHP Notice: Undefined index: upfile in /data/nakura/writable/g.php on line 74PHP message: PHP Notice: Trying to access array offset on value of type null in /data/nakura/writable/g.php on line 74PHP message: PHP Notice: Undefined index: upfile in /data/nakura/writable/g.php on line 75PHP message: PHP Notice: Trying to access array offset on value of type null in /data/nakura/writable/g.php on line 75PHP message: PHP Notice: Undefined variable: out in /data/nakura/writable/g.php on line 100PHP message: PHP Notice: Undefined variable: act in /data/nakura/writable/g.php on line 107PHP message: PHP Notice: Undefined variable: upcook in /data/nakura/writable/g.php on line 222PHP message: PHP Notice: Undefined variable: delid in /data/nakura/writable/g.php on line 234PHP message: PHP Notice: Undefined variable: del in /data/nakura/writable/g.php on line 264PHP message: PHP Notice: Undefined variable: act in /data/nakura/writable/g.php on line 273PHP message: PHP Notice: Undefined variable: arrow in /data/nakura/writable/g.php on line 392PHP message: PHP Notice: Undefined offset: 5 in /data/nakura/writable/g.php on line 401PHP message: PHP Notice: Undefined variable: page in /data/nakura/writable/g.php on line 465PHP message: PHP Notice: Undefined variable: page in /data/nakura/writable/g.php on line 466PHP message: PHP Notice: Undefined variable: next in /data/nakura/writable/g.php on line 174PHP message: PHP Notice: Undefined variable: base_php in /data/nakura/writable/g.php on line 185" while reading

When I turn it off, I can upload but still get the same exact error. It's on now, you can try uploading on https://up.heyuri.net/g.php

chen-chan1 commented 5 months ago

i see it. that deadly line version check i talked about. it makes invisibles variables anyone can set .

since i belive moduel is loaded in fromthe config, it cant acsseses the invisable file varables. so try moving the requires after the if statement .

https://github.com/Heyuri/Uploader/blob/main/warota.php#L65

chen-chan1 commented 5 months ago

if that soaw not work. u can go into the moudel and use the propwr super gl

kaguy4 commented 5 months ago

I got this shorter error while trying to upload while anti flood thing was turned on, though it failed to go through

2024/04/22 18:43:41 [error] 18751#18751: *33983981 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: out in /data/nakura/writable/g.php on line 100PHP message: PHP Notice: Undefined variable: act in /data/nakura/writable/g.php on line 107PHP message: PHP Notice: Undefined variable: upcook in /data/nakura/writable/g.php on line 222PHP message: PHP Notice: Undefined variable: delid in /data/nakura/writable/g.php on line 234PHP message: PHP Notice: Undefined variable: del in /data/nakura/writable/g.php on line 264PHP message: PHP Notice: Undefined variable: act in /data/nakura/writable/g.php on line 273PHP message: PHP Warning: require_once(.mod/antiflood.php): failed to open stream: No such file or directory in /data/nakura/writable/g.php on line 312PHP message: PHP Fatal error: require_once(): Failed opening required '.mod/antiflood.php' (include_path='.:/usr/share/php') in /data/nakura/writable/g.php on line 312" while reading response header from upstream, client: 94.123.224.135, server: up.heyuri.net, request: "POST /g.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "up.heyuri.net", referrer: "https://up.heyuri.net/g.php"

When I turn it off, it still goes, and I still get the longer error.

u can go into the moudel and use the propwr super gl

super gl? There is an issue with the module, but it writes stuff to error log even when turned off.

chen-chan1 commented 5 months ago

mah fucking post. i didnt mean to close it. its bc mobil sucks. basicly hachi should change it to use the superglobal $_FILES['name'] insted of the invisable variables that get created by request

chen-chan1 commented 5 months ago

reading ur error. it cant get thoese invisable extracted varables

hachikuji-san commented 5 months ago

Failed opening required '.mod/antiflood.php'

It seems like a problem with the value of ROOTPATH. Post the line where ROOTPATH is defined here.

kaguy4 commented 5 months ago

I fixed it now by setting it to: define('ROOTPATH', '/data/nakura/writable/'); // main path for project g.php is at /data/nakura/writable/g.php Default dot didn't work for some reason. Maybe it lacks a "/"?

kaguy4 commented 5 months ago

adding a / to where it's defined in antiflood.php didn't fix it, probably some other issue... But not rly important