ajpro Posted May 10, 2017 Share Posted May 10, 2017 Hi, I have the following code which is causing some trouble: foreach ($custom_fields as $custom_field) { if (($custom_field['location'] == 'address') && $custom_field['required'] && empty($this->request->post['custom_field'][$custom_field['custom_field_id']])) { $this->error['custom_field'][$custom_field['custom_field_id']] = sprintf($this->language->get('error_custom_field'), $custom_field['name']); } elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation'] && $custom_field['location'] == 'address')) && !filter_var($this->request->post['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) { $this->error['custom_field'][$custom_field['custom_field_id']] = sprintf($this->language->get('error_custom_field_validate'), $custom_field['name']); } } I works properly in PHP Version 7.0.15, but gives the above mentioned error in PHP Version 5.3.27. How can this be rectified? The bolded code is where the error occurs. Thanks Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted May 10, 2017 Share Posted May 10, 2017 (edited) Your empty() check is fudged up. You're missing the closing parenthesis. PHP 5.3 is ancient and doesn't support expressions within empty(), so that's why it won't even parse the code. Edited May 10, 2017 by Jacques1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.