Skip to content

Commit c7b1d76

Browse files
committed
fix bug #55285 XMLReader::getAttribute/No/Ns methods inconsistency
1 parent 2a1bd12 commit c7b1d76

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,8 @@ PHP NEWS
5555
. Implemented FR #65634 (HTTP wrapper is very slow with protocol_version
5656
1.1). (Adam)
5757

58+
- XMLReader:
59+
. Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency).
60+
(Mike)
61+
5862
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ PHP X.Y UPGRADE NOTES
6161
CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file
6262
do not work unless it is explicitly set to false.
6363

64+
- XMLReader:
65+
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
66+
the attribute could not be found, just like XMLReader::getAttribute.
67+
6468
========================================
6569
5. New Functions
6670
========================================

ext/xmlreader/php_xmlreader.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,6 @@ PHP_METHOD(xmlreader, getAttributeNo)
588588
if (retchar) {
589589
RETVAL_STRING(retchar, 1);
590590
xmlFree(retchar);
591-
return;
592-
} else {
593-
RETURN_EMPTY_STRING();
594591
}
595592
}
596593
/* }}} */
@@ -622,9 +619,6 @@ PHP_METHOD(xmlreader, getAttributeNs)
622619
if (retchar) {
623620
RETVAL_STRING(retchar, 1);
624621
xmlFree(retchar);
625-
return;
626-
} else {
627-
RETURN_EMPTY_STRING();
628622
}
629623
}
630624
/* }}} */

0 commit comments

Comments
 (0)