summaryrefslogtreecommitdiff
path: root/program/include/rcmail.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-12 05:44:28 -0500
committerAleksander Machniak <alec@alec.pl>2015-01-12 05:44:28 -0500
commitc6efcf5e6d11a0f236daff3aa3bd6532c77726d3 (patch)
tree7135cf595e0489d2640ac72d48a53b6ac408078d /program/include/rcmail.php
parent49b1c16c464586d826e974cd2223090923207516 (diff)
Fix blocked.gif image usage with assets_dir set
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r--program/include/rcmail.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index a16319f72..2327109c0 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -2284,6 +2284,29 @@ class rcmail extends rcube
return $result;
}
+ /**
+ * Get resource file content (with assets_dir support)
+ *
+ * @param string $name File name
+ */
+ public function get_resource_content($name)
+ {
+ if (!strpos($name, '/')) {
+ $name = "program/resources/$name";
+ }
+
+ $assets_dir = $this->config->get('assets_dir');
+
+ if ($assets_dir) {
+ $path = slashify($assets_dir) . $name;
+ if (@file_exists($path)) {
+ $name = $path;
+ }
+ }
+
+ return file_get_contents($name, false);
+ }
+
/************************************************************************
********* Deprecated methods (to be removed) *********