Skip to content

Commit

Permalink
Fix bug while selecting pages within frontend; catch NULL and '0'
Browse files Browse the repository at this point in the history
  • Loading branch information
olafgleba committed Dec 24, 2011
1 parent 4ad0eb8 commit 1a28a46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions welcompose/core/content_classes/page.class.php
Expand Up @@ -435,7 +435,7 @@ public function selectPages ($params = array())
}
// Include only unprotected pages
if (!empty($protect) && is_numeric($protect)) {
$sql .= " AND `content_pages`.`protect` IS NULL ";
$sql .= " AND `content_pages`.`protect` IS NULL OR 0 ";
}

/**
Expand All @@ -455,11 +455,11 @@ public function selectPages ($params = array())

// Include only non excluded pages
if (empty($exclude)) {
$sql .= " AND `content_pages`.`exclude` IS NULL ";
$sql .= " AND `content_pages`.`exclude` IS NULL OR 0 ";
}
// Include only visible pages
if (empty($draft)) {
$sql .= " AND `content_pages`.`draft` IS NULL ";
$sql .= " AND `content_pages`.`draft` IS NULL OR 0 ";
}

// add sorting
Expand Down

0 comments on commit 1a28a46

Please sign in to comment.