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)
{
if (!$this->sieve) {
return $this->_set_error(self::ERROR_INTERNAL);
}
if ($this->current == $name) {
if ($this->current === $name) {
return true;
}
$script = $this->sieve->getScript($name);
$script = $this->get_script($name);
if (is_a($script, 'PEAR_Error')) {
return $this->_set_error(self::ERROR_OTHER);
if ($script === false) {
return false;
}
// try to parse from Roundcube format
// try to parse to Roundcube format
$this->script = $this->_parse($script);
$this->current = $name;
@ -394,7 +390,7 @@ class rcube_sieve
return $this->_set_error(self::ERROR_INTERNAL);
}
// try to parse from Roundcube format
// try to parse to Roundcube format
$this->script = $this->_parse($script);
}

Loading…
Cancel
Save