Our sample code should really initialize variables properly ...
1.1 --- a/system/lib-custom.php.dist Sat Oct 17 19:54:49 2009 +0200
1.2 +++ b/system/lib-custom.php.dist Sat Oct 17 20:02:27 2009 +0200
1.3 @@ -63,6 +63,8 @@
1.4 {
1.5 global $_RIGHTS, $_CST_VERBOSE;
1.6
1.7 + $retval = '';
1.8 +
1.9 if ($_CST_VERBOSE) {
1.10 COM_errorLog('**** Inside phpblock_showrights in lib-custom.php ****', 1);
1.11 }
1.12 @@ -224,6 +226,8 @@
1.13 {
1.14 global $_CONF, $_TABLES;
1.15
1.16 + $retval = '';
1.17 +
1.18 $var = "Value from custom table";
1.19 $retval .= '<tr>
1.20 <td align="right"><b>Custom Fields:</b></td>
1.21 @@ -249,6 +253,8 @@
1.22 {
1.23 global $_CONF, $_TABLES;
1.24
1.25 + $retval = '';
1.26 +
1.27 $var = "Value from custom table";
1.28 $cookietimeout = DB_getitem($_TABLES['users'], 'cookietimeout', $uid);
1.29 $selection = '<select name="cooktime">' . LB;
1.30 @@ -299,6 +305,8 @@
1.31 {
1.32 global $_CONF, $_TABLES, $LANG04;
1.33
1.34 + $retval = '';
1.35 +
1.36 if (!empty ($msg) && ($msg != 'new')) {
1.37 $retval .= COM_startBlock($LANG04[21]) . $msg . COM_endBlock();
1.38 }
1.39 @@ -374,7 +382,9 @@
1.40 function CUSTOM_userCheck ($username, $email='')
1.41 {
1.42 global $MESSAGE;
1.43 +
1.44 $retval = '';
1.45 +
1.46 // Example, check that the full name has been entered
1.47 // and complain if it's missing
1.48 if (empty($_POST['fullname'])) {
1.49 @@ -407,6 +417,7 @@
1.50 global $_CONF, $_USER, $_TABLES;
1.51
1.52 $retval = '';
1.53 +
1.54 if( !isset( $_USER['noboxes'] )) {
1.55 if( !empty( $_USER['uid'] )) {
1.56 $noboxes = DB_getItem( $_TABLES['userindex'], 'noboxes', "uid = {$_USER['uid']}" );