From c6efcf5e6d11a0f236daff3aa3bd6532c77726d3 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 12 Jan 2015 05:44:28 -0500 Subject: Fix blocked.gif image usage with assets_dir set --- program/include/rcmail.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'program/include/rcmail.php') 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) ********* -- cgit v1.2.3