From 56303634f1d4d8808d3f202ba66944757efa39c2 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 13 Aug 2004 22:24:09 +0000 Subject: [PATCH] Install tweaks: * Die more dramatically when XML module is missing; explicitly mention Mandrake solution * Don't allow blank db username, as this breaks * Apply slashes escapes on the license metadata; these come from outside for CC licenses and while we trust them, they might change and break --- config/index.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/config/index.php b/config/index.php index 69fd27eb85..85890fa642 100644 --- a/config/index.php +++ b/config/index.php @@ -244,7 +244,9 @@ $conf->xml = function_exists( "utf8_encode" ); if( $conf->xml ) { print "
  • Have XML / Latin1-UTF-8 conversion support.
  • \n"; } else { - print "
  • XML / Latin1-UTF-8 conversion is missing! Wiki will probably not work.
  • \n"; + dieout( "PHP's XML module is missing; the wiki requires functions in + this module and won't work in this configuration. + If you're running Mandrake, install the php-xml package." ); } $memlimit = ini_get( "memory_limit" ); @@ -329,6 +331,9 @@ $errs = array(); if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki" || $conf->Sitename == "Mediawiki" ) { $errs["Sitename"] = "Must not be blank or \"MediaWiki\"."; } +if( $conf->DBuser == "" ) { + $errs["DBuser"] = "Must not be blank"; +} if( $conf->DBpassword == "" ) { $errs["DBpassword"] = "Must not be blank"; } @@ -798,7 +803,10 @@ function writeLocalSettings( $conf ) { # Add slashes to strings for double quoting $slconf = array_map( "escapePhpString", get_object_vars( $conf ) ); - + if( $conf->License == 'gfdl' ) { + # Needs literal string interpolation for the current style path + $slconf['RightsIcon'] = $conf->RightsIcon; + } $sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":"; return " @@ -889,10 +897,10 @@ if ( \$wgCommandLineMode ) { ## License and Creative Commons licenses are supported so far. {$rights}\$wgEnableCreativeCommonsRdf = true; \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright -\$wgRightsUrl = \"{$conf->RightsUrl}\"; -\$wgRightsText = \"{$conf->RightsText}\"; -\$wgRightsIcon = \"{$conf->RightsIcon}\"; -# \$wgRightsCode = \"{$conf->RightsCode}\"; # Not yet used +\$wgRightsUrl = \"{$slconf['RightsUrl']}\"; +\$wgRightsText = \"{$slconf['RightsText']}\"; +\$wgRightsIcon = \"{$slconf['RightsIcon']}\"; +# \$wgRightsCode = \"{$slconf['RightsCode']}\"; # Not yet used "; } -- 2.20.1