Fix PHP Fatal error: Uncaught Error: Using $this when not in object (#6959)

pull/6977/head
Aleksander Machniak 5 years ago
parent a3c491d5cb
commit 1d9ddf9d33

@ -2237,7 +2237,7 @@ class rcube_sieve_engine
'type' => 'text',
'name' => '_action_interval[' . $id . ']',
'id' => 'action_interval' . $id,
'value' => rcube_sieve_vacation::vacation_interval($action),
'value' => rcube_sieve_vacation::vacation_interval($action, $this->exts),
'size' => 2,
'class' => $this->error_class($id, 'action', 'interval', 'action_interval'),
));

@ -125,7 +125,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
return $this->sieve->error();
}
private function vacation_rule()
protected function vacation_rule()
{
if ($this->script_name === false || $this->script_name === null || !$this->sieve->load($this->script_name)) {
return;
@ -164,7 +164,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
$this->vacation['list'] = $list;
}
private function vacation_post()
protected function vacation_post()
{
if (empty($_POST)) {
return;
@ -388,7 +388,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
}
}
$interval_txt = $interval->show(self::vacation_interval($this->vacation));
$interval_txt = $interval->show(self::vacation_interval($this->vacation, $this->exts));
if ($seconds_extension) {
$interval_select = new html_select(array('name' => 'vacation_interval_type'));
$interval_select->add($this->plugin->gettext('days'), 'days');
@ -521,7 +521,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
return $out;
}
public static function build_regexp_tests($date_from, $date_to, &$error)
protected static function build_regexp_tests($date_from, $date_to, &$error)
{
$tests = array();
$dt_from = rcube_utils::anytodatetime($date_from);
@ -562,7 +562,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
return $tests;
}
public static function parse_regexp_tests($tests)
protected static function parse_regexp_tests($tests)
{
$rx_from = '/^\(([0-9]{2}).*\)\s([A-Za-z]+)\s([0-9]{4})/';
$rx_to = '/^\(.*([0-9]{2})\)\s([A-Za-z]+)\s([0-9]{4})/';
@ -588,10 +588,10 @@ class rcube_sieve_vacation extends rcube_sieve_engine
/**
* Get current vacation interval
*/
public static function vacation_interval(&$vacation)
public static function vacation_interval(&$vacation, $extensions = array())
{
$rcube = rcube::get_instance();
$seconds_extension = in_array('vacation-seconds', $this->exts);
$seconds_extension = in_array('vacation-seconds', $extensions);
if (isset($vacation['seconds'])) {
$interval = $vacation['seconds'];

Loading…
Cancel
Save