From: Erik Lundin Date: Tue, 12 Nov 2019 00:04:45 +0000 (+0100) Subject: Fix upload IP check X-Git-Tag: 4.1.0~7 X-Git-Url: https://git.p6c8.net/jirafeau.git/commitdiff_plain/a00401257a73daf0449386e57ee9a811e2a4f408?ds=sidebyside;hp=a00401257a73daf0449386e57ee9a811e2a4f408 Fix upload IP check If no IP addresses are listed at 'upload_ip_nopassword', index.php won't show any login form and indicate the session as authenticated. During the actual upload, script.php will show the error 'Error 2: No password nor allowed IP'. The reason is that jirafeau_challenge_upload_ip returns true if the supplied IP whitelist is empty, but uploading without a password doesn't work this way (and shouldn't). I took the liberty to split 'jirafeau_challenge_upload_ip' into one function for the normal IP check, and one for checking if allowed to upload without a password. Having function names that clearly communicates the intent makes it easier to avoid bugs. ---