BlogoText / blogotext

A little more than a lightweight SQLite Blog-Engine.
Other
136 stars 30 forks source link

Error on file page afte file deletion #327

Closed extragornax closed 6 years ago

extragornax commented 6 years ago

Hello,

Little php error / warning when deleting a file from another page and reloading. Procedure:

`Notice: Undefined variable: files in /srv/http/blogotext/admin/fichiers.php on line 489

Warning: Invalid argument supplied for foreach() in /srv/http/blogotext/admin/fichiers.php on line 489`

The error is coming from the file existance loop

sublime_text_2017-10-11_10-53-55

remrem commented 6 years ago

you working on it or I take a look ?

extragornax commented 6 years ago

You can take a look at it if you want, I'm trying to get why we use mebibytes instead of megabytes

remrem commented 6 years ago

Ok, I handle this. "mebibytes" ? Check your lang file ?

extragornax commented 6 years ago

@remrem Check this chrome_2017-10-11_11-58-14 MiB are mebibytes in french it's the same chrome_2017-10-11_12-01-14

The word is based on $maxFileSize = format_size(min(return_bytes(ini_get('upload_max_filesize')), return_bytes(ini_get('post_max_size'))));

Should I post an issue about it ?

remrem commented 6 years ago

My bad, forget about this ... ;) You want to replace mebi by mega ?

extragornax commented 6 years ago

@remrem that's up to you, megabytes seem more logical though

extragornax commented 6 years ago

Adding an if statement to check if files exists seems to have fixed the issue. I'll push an editable PR soon sublime_text_2017-10-11_13-44-06 @remrem

remrem commented 6 years ago

not really, mega is a prefixes (like kilo, giga...) from the SI wich means (x1000), but (every ?) OS use the binary prefixes (1024 and not 1000).
I think it's a better idea to keep the binary prefixes, it's less mindfuck than Mo, Mo, Mb, MB.
And you can take a look on the wikipedia article, seem's the right way to do.

extragornax commented 6 years ago

2MB and 2MiB are so similar in size anyway, not an issue

extragornax commented 6 years ago

PR #329

remrem commented 6 years ago

I think we can close this issue ?

extragornax commented 6 years ago

Fixed