On Thu, Sep 24, 2020 at 3:34 PM Jeffrey Walton <[email protected]> wrote: > > Hi Everyone, > > Our site is at https://www.cryptopp.com/wiki. > > Since the Mediawiki 1.34.3 upgrade, the wiki serves each page with the > following at the top: > > <br /> > <b>Warning</b>: php_uname() has been disabled for security reasons in > <b>/var/www/html/w/includes/GlobalFunctions.php</b> on line > <b>1333</b><br /> > <!DOCTYPE html> > <html class="client-nojs" lang="en" dir="ltr"> > <head> > ... > > Any ideas how to fix things?
According to https://stackoverflow.com/q/47373937, the '@' can be used to suppress the warning: function wfHostname() { // Hostname overriding global $wgOverrideHostname; if ( $wgOverrideHostname !== false ) { return $wgOverrideHostname; } return @php_uname( 'n' ) ?: 'unknown'; } But I am not sure that is the best approach here. It seems like there should be an alternative method for this. For example, on [systemd] startup, run a shell script that executes 'uname -n' and write the result to a file. Then, have wfHostname() read the value from the file, if present. Can anyone confirm it's OK to add the '@' to silence the warning (rather than fixing the function)? (And I am not sure about the other transgressions present in an installation). Jeff _______________________________________________ MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
