Small code de-duplication

pull/6724/head
Aleksander Machniak 6 years ago
parent fd167152e1
commit a78f91f5dc

@ -363,21 +363,17 @@ class rcube_sieve
*/ */
public function load($name) public function load($name)
{ {
if (!$this->sieve) { if ($this->current === $name) {
return $this->_set_error(self::ERROR_INTERNAL);
}
if ($this->current == $name) {
return true; return true;
} }
$script = $this->sieve->getScript($name); $script = $this->get_script($name);
if (is_a($script, 'PEAR_Error')) { if ($script === false) {
return $this->_set_error(self::ERROR_OTHER); return false;
} }
// try to parse from Roundcube format // try to parse to Roundcube format
$this->script = $this->_parse($script); $this->script = $this->_parse($script);
$this->current = $name; $this->current = $name;
@ -394,7 +390,7 @@ class rcube_sieve
return $this->_set_error(self::ERROR_INTERNAL); return $this->_set_error(self::ERROR_INTERNAL);
} }
// try to parse from Roundcube format // try to parse to Roundcube format
$this->script = $this->_parse($script); $this->script = $this->_parse($script);
} }

Loading…
Cancel
Save