|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|