summaryrefslogtreecommitdiff
path: root/modules/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-12-14 20:10:45 +0000
committerDries Buytaert <dries@buytaert.net>2005-12-14 20:10:45 +0000
commit764f1177efe7bafe5ab47b21968d4b0921c3896c (patch)
treeb0d25865abedeed7d251bef5c43857e79bc6f210 /modules/node.module
parente53f58fbe0e6c033fce65bd0d7a76d25911ff158 (diff)
downloadbrdo-764f1177efe7bafe5ab47b21968d4b0921c3896c.tar.gz
brdo-764f1177efe7bafe5ab47b21968d4b0921c3896c.tar.bz2
- Patch #40631 by Chris Johnson: is_array() slower than isset() or empty().
Diffstat (limited to 'modules/node.module')
-rw-r--r--modules/node.module8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/node.module b/modules/node.module
index 32a4d98c7..0a7d3b75f 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -315,7 +315,7 @@ function node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
foreach (module_implements('nodeapi') as $name) {
$function = $name .'_nodeapi';
$result = $function($node, $op, $a3, $a4);
- if (is_array($result)) {
+ if (isset($result) && is_array($result)) {
$return = array_merge($return, $result);
}
else if (isset($result)) {
@@ -751,10 +751,10 @@ function node_search($op = 'search', $keys = null) {
case 'post':
// Insert extra restrictions into the search keywords string.
$edit = &$_POST['edit'];
- if (is_array($edit['type'])) {
+ if (isset($edit['type']) && is_array($edit['type'])) {
$keys = search_query_insert($keys, 'type', implode(',', array_keys($edit['type'])));
}
- if (is_array($edit['category'])) {
+ if (isset($edit['category']) && is_array($edit['category'])) {
$keys = search_query_insert($keys, 'category', implode(',', $edit['category']));
}
if ($edit['or'] != '') {
@@ -1172,7 +1172,7 @@ function theme_node_admin_nodes($form) {
$header = array(NULL, t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));
$output .= form_render($form['options']);
- if (is_array($form['title'])) {
+ if (isset($form['title']) && is_array($form['title'])) {
foreach (element_children($form['title']) as $key) {
$row = array();
$row[] = form_render($form['nodes'][$key]);