From 072e90840fda01cc3280b69f5b462456657cd7c0 Mon Sep 17 00:00:00 2001
From: mdtrooper <tres.14159@gmail.com>
Date: Wed, 13 Nov 2013 14:36:18 +0000
Subject: [PATCH] 2013-11-13 Miguel de Dios <miguel.dedios@artica.es>

	* include/functions_html.php: fixed the checks for duplicate images
	in the function "html_print_image" into the metaconsole
	installations.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9072 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_console/ChangeLog                  |  6 ++++++
 pandora_console/include/functions_html.php | 20 ++++++++++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index 779ffac1f9..403be6b687 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-13 Miguel de Dios <miguel.dedios@artica.es>
+	
+	* include/functions_html.php: fixed the checks for duplicate images
+	in the function "html_print_image" into the metaconsole
+	installations.
+
 2013-11-13 Miguel de Dios <miguel.dedios@artica.es>
 	
 	* operation/visual_console/render_view.php,
diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php
index ec6449e153..a07c2a3206 100644
--- a/pandora_console/include/functions_html.php
+++ b/pandora_console/include/functions_html.php
@@ -1639,22 +1639,30 @@ function html_print_image ($src, $return = false, $options = false, $return_src
 		
 	}
 	
-	if (!$relative) {
-		$src_tmp = $src;
-		$src = ui_get_full_url($src);
-	}
 	
 	// If metaconsole is activated and image doesn't exists try to search on normal console
+	
 	if (defined('METACONSOLE')) {
 		if (!$relative) {
-			if (false === @file_get_contents($src, 0, null, 0, 1)) {
-				$src = ui_get_full_url('../../' . $src_tmp); 
+			if (!is_readable("enterprise/meta/" . $src)) {
+				$src = ui_get_full_url('../../' . $src);
+				html_debug_print($src, true);
+			}
+			else {
+				html_debug_print("###### " . $src, true);
 			}
 		}
 		else {
 			$src = '../../' . $src;
 		}
 	}
+	else {
+		if (!$relative) {
+			$src_tmp = $src;
+			$src = ui_get_full_url($src);
+		}
+	}
+
 	
 	// Only return src field of image
 	if ($return_src) {