OpenCart中的PHP语法错误


PHP Syntax Error in OpenCart

我尝试在管理面板中访问opencart的客户部分并收到此消息

解析错误:语法错误,意外的"&&"(T_BOOLEAN_AND),在第 1105 行的/var/www/vhosts/cloud9herbals.com/cloud9hemp/dev/admin/controller/customer/customer.php 中期望")"

这是第 1105 行的代码

} elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation'] && $custom_field['location'] == 'address')) && !filter_var($value['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {

如果这还不够,这里是整个状态

foreach ($custom_fields as $custom_field) {
                if (($custom_field['location'] == 'address') && $custom_field['required'] && empty($value['custom_field'][$custom_field['custom_field_id']])) {
                    $this->error['address'][$key]['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($value['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {
                    $this->error['address'][$key]['custom_field'][$custom_field['custom_field_id']] = sprintf($this->language->get('error_custom_field_validate'), $custom_field['name']);
                }
            }

我对 php 知之甚少,但真的很想解决这个问题

这个

empty($custom_field['validation'] && $custom_field['location'] == 'address'))

需要

empty($custom_field['validation']) && $custom_field['location'] == 'address')