User:Allen4names/Bug 14977

The following code was copied from DefaultSettings.php in MediaWiki 1.16.0.

Here is the modified code.


 * Notes
 * If $wgServerName matches '/^[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:/' it is either an unbracketed IPv6 address or garbage.
 * If $wgServerName has just one colon in it or has ']:' as a substring don't add a port number.

This can be used to test for garbage.