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 Link to comment Share on other sites More sharing options...
Jacques1 Posted May 10, 2017 Share Posted May 10, 2017 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.