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)
13901390 }
13911391
13921392 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+
13931398 if (!sxe -> xpath ) {
13941399 sxe -> xpath = xmlXPathNewContext ((xmlDocPtr ) sxe -> document -> ptr );
13951400 }
Original file line number Diff line number Diff line change 3535} catch (Error $ e ) {
3636 echo $ e ->getMessage (), "\n" ;
3737}
38+ try {
39+ var_dump ($ sxe ->registerXPathNamespace ('' , '' ));
40+ } catch (Error $ e ) {
41+ echo $ e ->getMessage (), "\n" ;
42+ }
3843try {
3944 var_dump ($ sxe ->foo );
4045} catch (Error $ e ) {
@@ -49,3 +54,4 @@ SimpleXMLElement is not properly initialized
4954SimpleXMLElement is not properly initialized
5055SimpleXMLElement is not properly initialized
5156SimpleXMLElement is not properly initialized
57+ SimpleXMLElement is not properly initialized
You can’t perform that action at this time.
0 commit comments