From 9905af7587a96cc4eabfc28563f23da5ca6ba539 Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Sat, 12 Aug 2006 20:45:49 +0200 Subject: [PATCH] NULL fixes for the PHP code. --- php/xml-template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/xml-template.php b/php/xml-template.php index b5f7096..00f6e69 100644 --- a/php/xml-template.php +++ b/php/xml-template.php @@ -33,7 +33,7 @@ function XML_Template_process($node, $obj, $clean = 1) if ($child->node_type() == XML_ELEMENT_NODE) { $tag = $child->node_name(); $attrs = $child->attributes(); - if ($attrs != null) { + if (isset($attrs)) { foreach ($child->attributes() as $attr) { if ($attr->namespace_uri() == 'http://template.sesse.net/' && $attr->name() == 'id') { $id = $attr->value(); @@ -49,14 +49,14 @@ function XML_Template_process($node, $obj, $clean = 1) foreach (array_keys($obj) as $key) { # FIXME: we would want something like \Q and \E here... if (preg_match('/^' . $tag . '\/(.*)$/', $key, $matches) || - ($id != null && preg_match('/^#' . $id . '\/(.*)$/', $key, $matches))) { + (isset($id) && preg_match('/^#' . $id . '\/(.*)$/', $key, $matches))) { $child->set_attribute($matches[1], $obj[$key]); } if ($processed) { continue; } - if ($key == $tag || ($id != null && $key == ('#'.$id))) { + if ($key == $tag || (isset($id) && $key == ('#'.$id))) { XML_Template_process($child, $obj[$key], $clean); $processed = true; } -- 2.39.2