Little code bug
-
This was exposed when a “Drag and Drop Multiple File Upload” field was added to a contact form. Would cause an exception as ‘none’ was being fed into round(); Changing this to 0 fixed the issue.
--- cf7a-antispam-flamingo.php (revision 5970) +++ cf7a-antispam-flamingo.php (working copy) @@ -333,7 +333,7 @@ $b8 = new CF7_AntiSpam_B8(); - $rating = ! empty( $message ) ? round( $b8->cf7a_b8_classify( $message ), 2 ) : 'none'; + $rating = ! empty( $message ) ? round( $b8->cf7a_b8_classify( $message ), 2 ) : 0; update_post_meta( $result['flamingo_inbound_id'], '_cf7a_b8_classification', round( $rating, 2 ) ); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Little code bug’ is closed to new replies.