If $p evaluates to zero, ignore it.

git-svn-id: https://develop.svn.wordpress.org/trunk@2007 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-12-28 17:36:28 +00:00
parent 8662dfbc33
commit fe196958e6
1 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ class WP_Query {
if ('' != $qv['name']) {
$this->is_single = true;
} else if (($qv['p'] != '') && ($qv['p'] != 'all')) {
} else if (($qv['p'] != '') && ($qv['p'] != 'all') && (intval($q['p']) != 0)) {
$this->is_single = true;
} else if (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
// If year, month, day, hour, minute, and second are set, a single
@ -293,7 +293,7 @@ class WP_Query {
}
// If a post number is specified, load that post
if (($q['p'] != '') && ($q['p'] != 'all')) {
if (($q['p'] != '') && ($q['p'] != 'all') && intval($q['p']) != 0) {
$q['p'] = (int) $q['p'];
$where = ' AND ID = ' . $q['p'];
}