File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1390,6 +1390,11 @@ SXE_METHOD(registerXPathNamespace)
1390
1390
}
1391
1391
1392
1392
sxe = Z_SXEOBJ_P (ZEND_THIS );
1393
+ if (!sxe -> document ) {
1394
+ zend_throw_error (NULL , "SimpleXMLElement is not properly initialized" );
1395
+ RETURN_THROWS ();
1396
+ }
1397
+
1393
1398
if (!sxe -> xpath ) {
1394
1399
sxe -> xpath = xmlXPathNewContext ((xmlDocPtr ) sxe -> document -> ptr );
1395
1400
}
Original file line number Diff line number Diff line change 35
35
} catch (Error $ e ) {
36
36
echo $ e ->getMessage (), "\n" ;
37
37
}
38
+ try {
39
+ var_dump ($ sxe ->registerXPathNamespace ('' , '' ));
40
+ } catch (Error $ e ) {
41
+ echo $ e ->getMessage (), "\n" ;
42
+ }
38
43
try {
39
44
var_dump ($ sxe ->foo );
40
45
} catch (Error $ e ) {
@@ -49,3 +54,4 @@ SimpleXMLElement is not properly initialized
49
54
SimpleXMLElement is not properly initialized
50
55
SimpleXMLElement is not properly initialized
51
56
SimpleXMLElement is not properly initialized
57
+ SimpleXMLElement is not properly initialized
You can’t perform that action at this time.
0 commit comments