From: Aryeh Gregor Date: Wed, 16 Jan 2008 17:42:46 +0000 (+0000) Subject: Improve sanity check on site name a bit: ban '#' (number sign). There are undoubtedl... X-Git-Tag: 1.31.0-rc.0~49960 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=b52eebdf36b901ec33072f33b5d5ed5c570e54f7;p=lhc%2Fweb%2Fwiklou.git Improve sanity check on site name a bit: ban '#' (number sign). There are undoubtedly several other characters that should be checked for, e.g., ':'. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c4c0cd39dd..af03bfab87 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -314,6 +314,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 12567) Fix for misformatted read-only messages on edit, protect. Also added proper read-only checks to several special pages. Have removed read-only checks from the general user permission framework. +* Creating a site with a name containing '#' is no longer permitted, since the + name will not work (but $wgSiteName is not checked if manually set). == Parser changes in 1.12 == diff --git a/config/index.php b/config/index.php index 3e591b4fb5..c4cf210cb1 100644 --- a/config/index.php +++ b/config/index.php @@ -599,8 +599,8 @@ print "
  • Environment check /* Check for validity */ $errs = array(); -if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki" || $conf->Sitename == "Mediawiki" ) { - $errs["Sitename"] = "Must not be blank or \"MediaWiki\""; +if( preg_match( '/^$|^mediawiki$|#/i', $conf->Sitename ) ) { + $errs["Sitename"] = "Must not be blank or \"MediaWiki\" and may not contain \"#\""; } if( $conf->DBuser == "" ) { $errs["DBuser"] = "Must not be blank";