I have been getting this error message displayed as a header on the website and in the site error_log:
[18-Nov-2017 23:06:13 America/New_York] PHP Warning: posix_uname() has been disabled for security reasons in /home/reddirtr/public_html/holland_college_mw19/includes/GlobalFunctions.php on line 1450
How can I change the code in GlobalFunctions.php to remove the warning?
function wfHostname() {
static $host;
if ( is_null( $host ) ) {
# Hostname overriding
global $wgOverrideHostname;
if ( $wgOverrideHostname !== false ) {
# Set static and skip any detection
$host = $wgOverrideHostname;
return $host;
}
if ( function_exists( 'posix_uname' ) ) {
// This function not present on Windows
$uname = posix_uname();
} else {
$uname = false;
}
if ( is_array( $uname ) && isset( $uname['nodename'] ) ) {
$host = $uname['nodename'];
} elseif ( getenv( 'COMPUTERNAME' ) ) {
# Windows computer name
$host = getenv( 'COMPUTERNAME' );
} else {
# This may be a virtual server.
$host = $_SERVER['SERVER_NAME'];
}
}
return $host;
}