clerkio / clerk-magento

Other
8 stars 20 forks source link

Wrong condition on empty string in ApiController.php #95

Closed fabianaromagnoli closed 3 months ago

fabianaromagnoli commented 9 months ago

This code in code/controllers/ApiController.php seems to have a typo. The if condition is:

if(str_replace(' ', '', $Additional_Field == ''))

and this condition is true only when $Additional_Field is an empty string, but I think that it was meant to exclude also a string that contains only spaces, so the condition should be:

if(str_replace(' ', '', $Additional_Field) == '')

See https://github.com/clerkio/clerk-magento/pull/94