Skip to content

Commit

Permalink
fixes undefined index notice
Browse files Browse the repository at this point in the history
PHP Notice:  Undefined index: enabled in
/Users/svanschu/GitHub/SchuWeb-Sitemap/components/com_schuweb_sitemap/mo
dels/sitemap.php on line 144
  • Loading branch information
svanschu committed Jan 2, 2017
1 parent b53f6e4 commit 022b6de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/com_schuweb_sitemap/models/sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ public function &getItem($pk = null)
$lastmod = $data->params->get('xmlLastMod');
// only display the Menüs which are activated
foreach ($data->selections as $key => $selection) {
if (is_null($selection["enabled"]) || $selection["enabled"] != 1) {
if (!isset($selection["enabled"]) || is_null($selection["enabled"]) || $selection["enabled"] != 1) {
unset($data->selections[$key]);
} else {
$data->selections[$key]["lastmod"] = $lastmod;
$data->selections[$key]["lastmod"] = $lastmod;
}
}

Expand Down

0 comments on commit 022b6de

Please sign in to comment.