File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -1291,16 +1291,24 @@ static int sxe_objects_compare(zval *object1, zval *object2) /* {{{ */
1291
1291
sxe1 = Z_SXEOBJ_P (object1 );
1292
1292
sxe2 = Z_SXEOBJ_P (object2 );
1293
1293
1294
- if (sxe1 -> node == NULL ) {
1295
- if (sxe2 -> node ) {
1296
- return 1 ;
1297
- } else if (sxe1 -> document -> ptr == sxe2 -> document -> ptr ) {
1294
+ if (sxe1 -> node != NULL && sxe2 -> node != NULL ) {
1295
+ /* Both nodes set: Only support equality comparison between nodes. */
1296
+ if (sxe1 -> node == sxe2 -> node ) {
1298
1297
return 0 ;
1299
1298
}
1300
- return 1 ;
1301
- } else {
1302
- return !(sxe1 -> node == sxe2 -> node );
1299
+ return ZEND_UNCOMPARABLE ;
1303
1300
}
1301
+
1302
+ if (sxe1 -> node == NULL && sxe2 -> node == NULL ) {
1303
+ /* Both nodes not set: Only support equality comparison between documents. */
1304
+ if (sxe1 -> document -> ptr == sxe2 -> document -> ptr ) {
1305
+ return 0 ;
1306
+ }
1307
+ return ZEND_UNCOMPARABLE ;
1308
+ }
1309
+
1310
+ /* Only one of the nodes set: Cannot compare. */
1311
+ return ZEND_UNCOMPARABLE ;
1304
1312
}
1305
1313
/* }}} */
1306
1314
You can’t perform that action at this time.
0 commit comments