@@ -1619,6 +1619,17 @@ bool php_phongo_apply_rp_options_to_client(mongoc_client_t *client, bson_t *opti
1619
1619
return false;
1620
1620
}
1621
1621
1622
+ /* Return early if there are no options to apply */
1623
+ if (bson_empty0 (options )) {
1624
+ return true;
1625
+ }
1626
+
1627
+ if (!bson_iter_init_find_case (& iter , options , "slaveok" ) &&
1628
+ !bson_iter_init_find_case (& iter , options , "readpreference" ) &&
1629
+ !bson_iter_init_find_case (& iter , options , "readpreferencetags" )) {
1630
+ return true;
1631
+ }
1632
+
1622
1633
new_rp = mongoc_read_prefs_copy (old_rp );
1623
1634
1624
1635
if (bson_iter_init_find_case (& iter , options , "slaveok" ) && BSON_ITER_HOLDS_BOOL (& iter )) {
@@ -1694,6 +1705,18 @@ bool php_phongo_apply_wc_options_to_client(mongoc_client_t *client, bson_t *opti
1694
1705
return false;
1695
1706
}
1696
1707
1708
+ /* Return early if there are no options to apply */
1709
+ if (bson_empty0 (options )) {
1710
+ return true;
1711
+ }
1712
+
1713
+ if (!bson_iter_init_find_case (& iter , options , "journal" ) &&
1714
+ !bson_iter_init_find_case (& iter , options , "safe" ) &&
1715
+ !bson_iter_init_find_case (& iter , options , "w" ) &&
1716
+ !bson_iter_init_find_case (& iter , options , "wtimeoutms" )) {
1717
+ return true;
1718
+ }
1719
+
1697
1720
wtimeoutms = mongoc_write_concern_get_wtimeout (old_wc );
1698
1721
1699
1722
new_wc = mongoc_write_concern_copy (old_wc );
0 commit comments