Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23484
Modified Files:
serendipity_admin_plugins.inc.php
Log Message:
Fix more problems with default values
Index: serendipity_admin_plugins.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_plugins.inc.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- serendipity_admin_plugins.inc.php 3 Sep 2004 23:01:19 -0000 1.43
+++ serendipity_admin_plugins.inc.php 3 Sep 2004 23:12:48 -0000 1.44
@@ -339,16 +339,18 @@
$cbag = new serendipity_property_bag;
$plugin->introspect_config_item($config_item, $cbag);
- $cname = htmlspecialchars($cbag->get('name'));
- $cdesc = htmlspecialchars($cbag->get('description'));
- $value = $plugin->get_config($config_item, 'unset');
- $is_unset = false;
+ $cname = htmlspecialchars($cbag->get('name'));
+ $cdesc = htmlspecialchars($cbag->get('description'));
+ $value = $plugin->get_config($config_item, 'unset');
+
+ /* Apparently no value was set for this config item */
if ($value === 'unset') {
+ /* Try and the default value for the config item */
$value = $cbag->get('default');
- $is_unset = true;
- if (empty($value)) {
- // Backwards compatibility to Plugins with no default property bag item
- $value = $plugin->get_config($config_item, false, true);
+
+ /* Still, we don't have a value, try and get (bool)false - from an old plugin */
+ if ($value === '') {
+ $value = $plugin->get_config($config_item, false, true);
}
}
$hvalue = (isset($_POST['serendipity']['plugin'][$config_item]) ? htmlspecialchars($_POST['serendipity']['plugin'][$config_item]) : htmlspecialchars($value));
@@ -439,7 +441,7 @@
if ($radio_value == 'true' && ($hvalue === '1' || $hvalue === 'true')) {
$checked = " checked";
- } elseif ($radio_value == 'false' && ($hvalue === '' || $hvalue === 'false') || $is_unset === true) {
+ } elseif ($radio_value == 'false' && ($hvalue === '' || $hvalue === 'false')) {
$checked = " checked";
} elseif ($radio_value == $hvalue) {
$checked = " checked";
|