Sometimes CRM_Contribute_BAO_Contribution :: checkDuplicate() will be passed unexpected paramaters. In these cases it incorrectly returns all the contributions in civicrm as duplicates. This results in a string of failures, sometimes causing user-submitted contributions to fail. The included patch adds some sanity checking. Also attached is an error report of a situation where unexpected parameters caused a contribution to fail. Oddly enough it doesn't happen on all contributions.