onokazu
onoka****@users*****
2005年 6月 11日 (土) 11:32:39 JST
Index: xoops2jp/html/class/xml/saxparser.php diff -u xoops2jp/html/class/xml/saxparser.php:1.2 xoops2jp/html/class/xml/saxparser.php:1.3 --- xoops2jp/html/class/xml/saxparser.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xml/saxparser.php Sat Jun 11 11:32:39 2005 @@ -1,5 +1,5 @@ <?php -// $Id: saxparser.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: saxparser.php,v 1.3 2005/06/11 02:32:39 onokazu Exp $ /******************************************************************************* Location: <b>xml/SaxParser.class</b><br> <br> @@ -160,8 +160,11 @@ { xml_parser_free($this->parser); - unset($this); - $this = null; + if (!method_exists($this, '__destruct')) { + unset($this); + } else { + $this->__destruct(); + } } /**************************************************************************** @@ -220,8 +223,8 @@ if (isset($this->tagHandlers[$tagName]) && is_subclass_of($this->tagHandlers[$tagName], 'xmltaghandler')) { $this->tagHandlers[$tagName]->handleBeginElement($this, $attributesArray); } else { - $this->handleBeginElementDefault($parser, $tagName, $attributesArray); - } + $this->handleBeginElementDefault($parser, $tagName, $attributesArray); + } } /**************************************************************************** @@ -238,8 +241,8 @@ if (isset($this->tagHandlers[$tagName]) && is_subclass_of($this->tagHandlers[$tagName], 'xmltaghandler')) { $this->tagHandlers[$tagName]->handleEndElement($this); } else { - $this->handleEndElementDefault($parser, $tagName); - } + $this->handleEndElementDefault($parser, $tagName); + } $this->level--; } @@ -256,8 +259,8 @@ if (isset($tagHandler) && is_subclass_of($tagHandler, 'xmltaghandler')) { $tagHandler->handleCharacterData($this, $data); } else { - $this->handleCharacterDataDefault($parser, $data); - } + $this->handleCharacterDataDefault($parser, $data); + } } /**************************************************************************** @@ -266,9 +269,9 @@ ****************************************************************************/ function handleProcessingInstruction($parser, &$target, &$data) { - if($target == 'php') { - eval($data); - } +// if($target == 'php') { +// eval($data); +// } } /**************************************************************************** @@ -307,61 +310,61 @@ } - /** - * The default tag handler method for a tag with no handler - * - * @abstract - */ - function handleBeginElementDefault($parser, $tagName, $attributesArray) - { - } - - /** - * The default tag handler method for a tag with no handler - * - * @abstract - */ - function handleEndElementDefault($parser, $tagName) - { - } - - /** - * The default tag handler method for a tag with no handler - * - * @abstract - */ - function handleCharacterDataDefault($parser, $data) - { - } - - /** - * Sets error messages - * - * @param $error string an error message - */ + /** + * The default tag handler method for a tag with no handler + * + * @abstract + */ + function handleBeginElementDefault($parser, $tagName, $attributesArray) + { + } + + /** + * The default tag handler method for a tag with no handler + * + * @abstract + */ + function handleEndElementDefault($parser, $tagName) + { + } + + /** + * The default tag handler method for a tag with no handler + * + * @abstract + */ + function handleCharacterDataDefault($parser, $data) + { + } + + /** + * Sets error messages + * + * @param $error string an error message + */ function setErrors($error) { $this->errors[] = trim($error); } - /** - * Gets all the error messages - * - * @param $ashtml bool return as html? - * @return mixed - */ + /** + * Gets all the error messages + * + * @param $ashtml bool return as html? + * @return mixed + */ function &getErrors($ashtml = true) { if (!$ashtml) { return $this->errors; } else { - $ret = ''; - if (count($this->errors) > 0) { - foreach ($this->errors as $error) { - $ret .= $error.'<br />'; - } - } - return $ret; + $ret = ''; + if (count($this->errors) > 0) { + foreach ($this->errors as $error) { + $ret .= $error.'<br />'; + } + } + return $ret; } } }