From efebcf9b720147d60f71d480cc817f34e94d508c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 11 Aug 2004 10:36:39 +0000 Subject: [PATCH] Make Creative Commons selection work again; pretty up its display a bit. --- config/index.php | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/config/index.php b/config/index.php index f72d4dc83b..c07a1016b8 100644 --- a/config/index.php +++ b/config/index.php @@ -333,7 +333,7 @@ if( $conf->SysopPass != $conf->SysopPass2 ) { $errs["SysopPass2"] = "Passwords don't match!"; } -$conf->License = importPost( "License", "none" ); +$conf->License = importRequest( "License", "none" ); if( $conf->License == "gfdl" ) { $conf->RightsUrl = "http://www.gnu.org/copyleft/fdl.html"; $conf->RightsText = "GNU Free Documentation License 1.2"; @@ -342,10 +342,10 @@ if( $conf->License == "gfdl" ) { } elseif( $conf->License == "none" ) { $conf->RightsUrl = $conf->RightsText = $conf->RightsCode = $conf->RightsIcon = ""; } else { - $conf->RightsUrl = importPost( "RightsUrl", "" ); - $conf->RightsText = importPost( "RightsText", "" ); - $conf->RightsCode = importPost( "RightsCode", "" ); - $conf->RightsIcon = importPost( "RightsIcon", "" ); + $conf->RightsUrl = importRequest( "RightsUrl", "" ); + $conf->RightsText = importRequest( "RightsText", "" ); + $conf->RightsCode = importRequest( "RightsCode", "" ); + $conf->RightsIcon = importRequest( "RightsIcon", "" ); } if( $conf->posted && ( 0 == count( $errs ) ) ) { @@ -644,11 +644,16 @@ if( count( $errs ) ) { $icon = urlencode( "$wgServer$wgUploadPath/wiki.png" ); $ccApp = htmlspecialchars( "http://creativecommons.org/license/?partner=$partner&exit_url=$exit&partner_icon_url=$icon" ); print "choose"; - ?> -
  • RightsUrl, "hidden" ); ?>
  • -
  • RightsText, "hidden" ); ?>
  • -
  • RightsCode, "hidden" ); ?>
  • -
  • RightsIcon, "hidden" ); ?>
  • + ?> (link will wipe out any other data in this form!) + License == "cc" ) { ?> + + +
    @@ -885,9 +890,9 @@ function dieout( $text ) { die( $text . "\n\n\n" ); } -function importPost( $name, $default = "" ) { - if( isset( $_POST[$name] ) ) { - $retval = $_POST[$name]; +function importVar( &$var, $name, $default = "" ) { + if( isset( $var[$name] ) ) { + $retval = $var[$name]; if ( get_magic_quotes_gpc() ) { $retval = stripslashes( $retval ); } @@ -897,6 +902,14 @@ function importPost( $name, $default = "" ) { return $retval; } +function importPost( $name, $default = "" ) { + return importVar( $_POST, $name, $default ); +} + +function importRequest( $name, $default = "" ) { + return importVar( $_REQUEST, $name, $default ); +} + function aField( &$conf, $field, $text, $type = "", $value = "" ) { if( $type != "" ) { $xtype = "type=\"$type\""; -- 2.20.1