Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20776
Modified Files:
serendipity_admin_plugins.inc.php
Log Message:
Fix broken boolean logic when the value was false or no value was set
Index: serendipity_admin_plugins.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_plugins.inc.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- serendipity_admin_plugins.inc.php 30 Aug 2004 18:56:19 -0000 1.42
+++ serendipity_admin_plugins.inc.php 3 Sep 2004 23:01:19 -0000 1.43
@@ -436,12 +436,15 @@
$id = htmlspecialchars($config_item . $radio_value);
$counter++;
$checked = "";
- if ($radio_value == 'true' && $hvalue == 1)
+
+ if ($radio_value == 'true' && ($hvalue === '1' || $hvalue === 'true')) {
$checked = " checked";
- if ($radio_value == 'false' && $is_unset == false && $hvalue == false)
+ } elseif ($radio_value == 'false' && ($hvalue === '' || $hvalue === 'false') || $is_unset === true) {
$checked = " checked";
- if ($radio_value == $hvalue)
+ } elseif ($radio_value == $hvalue) {
$checked = " checked";
+ }
+
if ($counter == 1) {
?>
<div>
|