Index: trunk/extensions/ContributionTracking/ContributionTracking.processor.php |
— | — | @@ -408,10 +408,12 @@ |
409 | 409 | } |
410 | 410 | |
411 | 411 | // Normalized amount |
412 | | - $repost['fields'][$amount_field_name] = $input['amount']; |
413 | | - if ( $input['amount_given'] ) { |
414 | | - $repost['fields'][$amount_field_name] = $input['amount_given']; |
| 412 | + $amount = $input['amount']; |
| 413 | + // If amount is not a number, use amount_given |
| 414 | + if ( !( preg_match( '/^\d+(\.(\d+)?)?$/', $amount ) ) && $input['amount_given'] ) { |
| 415 | + $amount = $input['amount_given']; |
415 | 416 | } |
| 417 | + $repost['fields'][$amount_field_name] = $amount |
416 | 418 | |
417 | 419 | // Tracking |
418 | 420 | $repost['fields']['custom'] = $input['contribution_tracking_id']; |