From 9a96dc6fb9e56507c1d140f1fb9a52b3024db948 Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Fri, 5 May 2017 01:01:15 +0300 Subject: [PATCH] 'file(...)' misused. --- library/attach_mod/displaying.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/attach_mod/displaying.php b/library/attach_mod/displaying.php index 1b84c2a21..0a010d9f6 100644 --- a/library/attach_mod/displaying.php +++ b/library/attach_mod/displaying.php @@ -74,7 +74,7 @@ function init_display_template($template_var, $replacement, $filename = 'viewtop $filename_2 = $template->files[$template_var]; - $str = implode('', @file($filename_2)); + $str = file_get_contents($filename_2); if (empty($str)) { die("Template->loadfile(): File $filename_2 for handle $template_var is empty"); } @@ -91,7 +91,7 @@ function init_display_template($template_var, $replacement, $filename = 'viewtop die("Template->make_filename(): Error - file $complete_filename does not exist"); } - $content = implode('', file($complete_filename)); + $content = file_get_contents($complete_filename); if (empty($content)) { die('Template->loadfile(): File ' . $complete_filename . ' is empty'); }