--- views_handler_filter_node_nid_php.inc.orig	2010-09-08 19:34:04.067464599 +0300
+++ views_handler_filter_node_nid_php.inc	2010-09-08 20:35:09.463465995 +0300
@@ -11,12 +11,13 @@
     return array(
       'OR' => t('OR'),
       'NOR' => t('NOR'),
+      'AND'=> t('AND'),
     );
   }
   
   function option_definition() { 
     $options = parent::option_definition();
-    $options['operator']['default'] = 'OR';
+    $options['operator']['default'] = 'AND';
     $options['value']['default'] = '';
     $options['handler']['default'] = 'php';
     return ($options);
@@ -45,14 +46,14 @@
     $rawcode = $this->value;
     //error_log('php: ' . print_r($rawcode,TRUE));
     if ($this->options['handler'] == 'php') {
-      $result = eval ($rawcode);
+      $result = (array) eval ($rawcode);  // if a function returns an empty array make sure it doesn't get converted to NULL
       //error_log('eval: ' . print_r($result,TRUE));
       if ($result === false) {
         watchdog('viewsphpfilter', "Parse error in PHP: $this->value; filter ignored", array(), WATCHDOG_ERROR);
         return;
       }
     } else $result = $rawcode;
-    if ($result == NULL) {
+    if ($result === NULL) {
       watchdog('viewsphpfilter', "PHP returned null; filter ignored", array(), WATCHDOG_NOTICE);
       return;
     }
@@ -69,11 +70,18 @@
     }
     if ($allints) {
       $this->ensure_my_table();
+     
+     if ($this->operator == 'AND') {
+		if(empty($result)) $this->query->add_where($this->options['group'], "true=false"); // nothing was added
+        else $this->query->add_where($this->options['group'], "node.nid IN (%s)", implode(",", $result));
+      }
       if ($this->operator == 'OR') {
-        $this->query->add_where($this->options['group'], "node.nid IN (%s)", implode(",", $result));
+		if(empty($result)) $this->query->add_where($this->options['group'], "true=true"); // nothing was added
+        else $this->query->add_where($this->options['group'], "node.nid IN (%s)", implode(",", $result));
       }
       else if ($this->operator == 'NOR' and !empty($result)) {
-        $this->query->add_where($this->options['group'], "node.nid NOT IN (%s)", implode(",", $result));
+		  if(empty($result)) $this->query->add_where($this->options['group'], "true=true");//allow everything since nothing was filtered out
+        else $this->query->add_where($this->options['group'], "node.nid NOT IN (%s)", implode(",", $result));
       }
     }
     else {
