Skip to content

Commit

Permalink
Update phpfm.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zhblue authored Sep 29, 2024
1 parent 29e911b commit 58f8ba7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion trunk/web/admin/phpfm.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ function stripslashes_deep($value){
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
// Server Vars
//php ver < 8.0 has no endsWith function
if (!function_exists('str_ends_with')) {
function str_ends_with( $haystack, $needle ) {
$length = strlen( $needle );
if( !$length ) {
return true;
}
return substr( $haystack, -$length ) === $needle;
}
}
// Server Vars
function get_client_ip() {
$ipaddress = '';
if (isset($_SERVER['HTTP_CLIENT_IP'])) $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
Expand Down

0 comments on commit 58f8ba7

Please sign in to comment.