opencart 中有一个函数,我需要替换如下:
protected function validateDelete() {
if (!$this->user->hasPermission('modify', 'catalog/download')) {
$this->error['warning'] = $this->language->get('error_permission');
应该:
protected function validateDelete() {
if (!$this->user->hasPermission('delete', 'catalog/download')) {
$this->error['warning'] = $this->language->get('error_permission_delete');
我努力了:
<search position="replace"><![CDATA[
protected function validateDelete() {
if (!$this->user->hasPermission('modify',]]></search>
<add><![CDATA[
protected function validateDelete() {
if (!$this->user->hasPermission('delete',
]]></add>
但它不工作。第三行出现在多个位置,因此不能仅替换为单行。
请帮忙