Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
If there is a CR (LF) after a manual mode formula in a field, the PHP parser breaks. #3270
If there is a CR (LF) after a manual mode formula in a field, the PHP parser breaks:
trimming the formula in PHP should prevent this error
What Version Of Caldera Forms, WordPress and PHP Are You Using?
WordPress Version: 5.2.2, PHP Version: 7.2.19-0ubuntu0.18.04.1, MySQL Version: 5.7.26, Caldera Forms Version: 1.8.5, WP_DEBUG:
Does Your Issue Persist When You Disable All Other Plugins and Switch To The Default Theme?
What Is The Unexpected Behaviour?
Submitting the form does nothing (spinner in the middle of the screen)
What PHP Errors Have You Logged While Reproducing This Bug?
@New0 I don't use a line break, but the person who created the manual calculation did add a line break after the formula, so it wasn't visible. And I suppose it didn't matter with a previous version of the plugin.
My first tests using
That makes me think we should trim the formula before saving it to the database, that would prevent my error and the case where it is saved with the backslash, which makes the calculation work on frontend but fails with new parser. ( we can also trim the formula before sending it to the new parser ).
@New0 I don't know when the line break started to break the parser, I just assumed it was working with the previous release.