[Bb-trac] [bbPress] #787: 'glob' returns FALSE on some PHP installs
causing foreach error
bbPress
bb-trac at lists.bbpress.org
Sat Feb 16 18:34:35 GMT 2008
#787: 'glob' returns FALSE on some PHP installs causing foreach error
----------------------+-----------------------------------------------------
Reporter: _ck_ | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Back-end | Version: 0.8.3.1
Severity: normal | Keywords:
----------------------+-----------------------------------------------------
Unfortunately [http://trac.bbpress.org/changeset/1089 changeset 1089] was
not enough.
Some PHP installs return a boolean FALSE when there are no glob matches.
This loads the error log with warnings on the foreach every time bbPress
is loaded.
Suggested (and tested) fix example:
{{{
// Load Plugins
if ( function_exists( 'glob' ) && is_callable( 'glob' ) &&
$glob=glob(BBPLUGINDIR . '_*.php') )
foreach ( $glob as $_plugin )
require($_plugin);
unset($_plugin);
do_action( 'bb_underscore_plugins_loaded' );
unset($glob);
}}}
--
Ticket URL: <http://trac.bbpress.org/ticket/787>
bbPress <http://bbpress.org/>
Innovative forum development
More information about the Bb-trac
mailing list