Updated Useful Functions for Plugin and Theme Security (markdown)

Erwan
2021-05-20 11:08:16 +02:00
parent 81ed598d0a
commit dd9f7d2673

@@ -20,6 +20,8 @@ function is_url_local($url) {
return ! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE); return ! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
} }
// Testing things out
$urls = [ $urls = [
'doesntexistblabla.com', 'https://wpscan.com', 'wpscan.com', '192.168.1.32', '127.0.0.1:9090', 'https://youtube.com:23', 'localhost', 'doesntexistblabla.com', 'https://wpscan.com', 'wpscan.com', '192.168.1.32', '127.0.0.1:9090', 'https://youtube.com:23', 'localhost',
'http://127.0.0.1', '127.1', 'https://0x7f.0x0.0x0.0x1', '0177.0.0.01', '2130706433', 'https://%6c%6f%63%61%6c%68%6f%73%74', 'http://0177.0.0.0x1:9090/aa.txt', '::1', 'https://[::1]:8080', 'http://[::ffff:127.0.0.1]:19983/' 'http://127.0.0.1', '127.1', 'https://0x7f.0x0.0x0.0x1', '0177.0.0.01', '2130706433', 'https://%6c%6f%63%61%6c%68%6f%73%74', 'http://0177.0.0.0x1:9090/aa.txt', '::1', 'https://[::1]:8080', 'http://[::ffff:127.0.0.1]:19983/'
@@ -59,5 +61,6 @@ function zip_only_contains_allowed_extensions($zip_path, array $allowed_extensio
return true; return true;
} }
// Testing things out
var_dump(zip_only_contains_allowed_extensions('midex.zip', ['png'])); var_dump(zip_only_contains_allowed_extensions('midex.zip', ['png']));
``` ```