From c6efcf5e6d11a0f236daff3aa3bd6532c77726d3 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 12 Jan 2015 05:44:28 -0500
Subject: [PATCH] Fix blocked.gif image usage with assets_dir set
---
program/include/rcmail.php | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index a16319f..2327109 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -2284,6 +2284,29 @@
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) *********
--
Gitblit v1.9.1