Skip to content

Commit

Permalink
fixed bug with possible undefined variable
Browse files Browse the repository at this point in the history
since the logic statement above uses or, there are times when $has_uri is unset
using (!empty($has_uri)) instead of ($has_uri) prevents PHP throwing an error/warning
  • Loading branch information
SystemDisc committed Aug 26, 2014
1 parent 335c86e commit 1989c3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fuel/modules/fuel/libraries/Fuel_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function get($module = NULL, $include_advanced = TRUE)
$modules = $this->get(NULL, FALSE);
foreach($modules as $key => $mod)
{
if (strtolower($mod->info('model_name')) == $module OR ($has_uri AND $mod->info('module_uri') == $module))
if (strtolower($mod->info('model_name')) == $module OR (!empty($has_uri) AND $mod->info('module_uri') == $module))
{
$module = $key;
break;
Expand Down Expand Up @@ -1138,4 +1138,4 @@ public function __get($var)
}

/* End of file Fuel_modules.php */
/* Location: ./modules/fuel/libraries/fuel/Fuel_modules.php */
/* Location: ./modules/fuel/libraries/fuel/Fuel_modules.php */

0 comments on commit 1989c3f

Please sign in to comment.