@@ -273,7 +273,7 @@ function setHandlerObj($obj)
273
273
*/
274
274
function _initHandlers ()
275
275
{
276
- if (!is_resource ( $ this ->parser ) ) {
276
+ if (!$ this ->parser ) {
277
277
return false ;
278
278
}
279
279
@@ -333,7 +333,7 @@ function _create()
333
333
} else {
334
334
$ xp = @xml_parser_create ($ this ->srcenc );
335
335
}
336
- if (is_resource ( $ xp) ) {
336
+ if ($ xp ) {
337
337
if ($ this ->tgtenc !== null ) {
338
338
if (!@xml_parser_set_option ($ xp , XML_OPTION_TARGET_ENCODING ,
339
339
$ this ->tgtenc )
@@ -544,7 +544,7 @@ function _parseString($data, $eof = false)
544
544
*/
545
545
function parseString ($ data , $ eof = false )
546
546
{
547
- if (!isset ( $ this ->parser ) || ! is_resource ( $ this -> parser ) ) {
547
+ if (!$ this ->parser ) {
548
548
$ this ->reset ();
549
549
}
550
550
@@ -569,9 +569,9 @@ function parseString($data, $eof = false)
569
569
**/
570
570
function free ()
571
571
{
572
- if (isset ( $ this ->parser ) && is_resource ( $ this -> parser ) ) {
572
+ if ($ this ->parser ) {
573
573
xml_parser_free ($ this ->parser );
574
- unset( $ this ->parser ) ;
574
+ $ this ->parser = null ;
575
575
}
576
576
if (isset ($ this ->fp ) && is_resource ($ this ->fp )) {
577
577
fclose ($ this ->fp );
@@ -734,7 +734,7 @@ class XML_Parser_Error extends PEAR_Error
734
734
*/
735
735
function __construct ($ msgorparser = 'unknown error ' , $ code = 0 , $ mode = PEAR_ERROR_RETURN , $ level = E_USER_NOTICE )
736
736
{
737
- if (is_resource ($ msgorparser )) {
737
+ if (! is_string ($ msgorparser )) {
738
738
$ code = xml_get_error_code ($ msgorparser );
739
739
$ msgorparser = sprintf ('%s at XML input line %d:%d ' ,
740
740
xml_error_string ($ code ),
0 commit comments