summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-11-03 16:15:44 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2014-11-03 16:15:44 +0100
commit8d526c49381d9ac646c1a9b31936e0104dc3a6dc (patch)
tree5bedf67780390bd0476fa8bfad8a3f836f517ccd
parent5c9ddcc052cb95c6bb1ae64e5bb36a3564414442 (diff)
Fix skin path handling in plugin context (#1488967):
The plugin skin directories are removed again from the search path after parsing of a plugin template has finished.
-rw-r--r--program/include/rcmail_output_html.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index 3d2f51ba1..026e9f869 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -462,6 +462,8 @@ EOF;
{
$plugin = false;
$realname = $name;
+ $plugin_skin_paths = array();
+
$this->template_name = $realname;
$temp = explode('.', $name, 2);
@@ -471,7 +473,6 @@ EOF;
$skin_dir = $plugin . '/skins/' . $this->config->get('skin');
// apply skin search escalation list to plugin directory
- $plugin_skin_paths = array();
foreach ($this->skin_paths as $skin_path) {
$plugin_skin_paths[] = $this->app->plugins->url . $plugin . '/' . $skin_path;
}
@@ -482,7 +483,7 @@ EOF;
$plugin_skin_paths[] = $this->app->plugins->url . $skin_dir;
}
- // add plugin skin paths to search list
+ // prepend plugin skin paths to search list
$this->skin_paths = array_merge($plugin_skin_paths, $this->skin_paths);
}
@@ -525,6 +526,8 @@ EOF;
'file' => __FILE__,
'message' => 'Error loading template for '.$realname
), true, $write);
+
+ $this->skin_paths = array_slice($this->skin_paths, count($plugin_skin_paths));
return false;
}
@@ -549,6 +552,9 @@ EOF;
$output = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $output);
$this->footer = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $this->footer);
+ // remove plugin skin paths from current context
+ $this->skin_paths = array_slice($this->skin_paths, count($plugin_skin_paths));
+
if (!$write) {
return $output;
}