summaryrefslogtreecommitdiff
path: root/program/include/rcube_template.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-08-06 09:25:45 +0000
committeralecpl <alec@alec.pl>2008-08-06 09:25:45 +0000
commitff73e02cced0abf176a5a7e8660860f6280da6fe (patch)
tree3470b8e0da1e975d6df3017a8cd3384b9b9f5137 /program/include/rcube_template.php
parentf0726b94b3e7073240b0aca1af4ee52d3920ea27 (diff)
- fread() replaced by file_get_contents(), see comments in #1484880
Diffstat (limited to 'program/include/rcube_template.php')
-rwxr-xr-xprogram/include/rcube_template.php22
1 files changed, 8 insertions, 14 deletions
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index 6f146e002..fb6541153 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -299,16 +299,13 @@ class rcube_template extends rcube_html_page
private function parse($name = 'main', $exit = true)
{
$skin_path = $this->config['skin_path'];
-
- // read template file
- $templ = '';
$path = "$skin_path/templates/$name.html";
- if (($fp = fopen($path, 'r')) === false) {
- $message = '';
+ // read template file
+ if (($templ = file_get_contents($path)) === false) {
ob_start();
- fopen($path, 'r');
- $message.= ob_get_contents();
+ file_get_contents($path);
+ $message = ob_get_contents();
ob_end_clean();
raise_error(array(
'code' => 501,
@@ -319,8 +316,6 @@ class rcube_template extends rcube_html_page
), true, true);
return false;
}
- $templ = fread($fp, filesize($path));
- fclose($fp);
// parse for specialtags
$output = $this->parse_conditions($templ);
@@ -529,14 +524,13 @@ class rcube_template extends rcube_html_page
// include a file
case 'include':
$path = realpath($this->config['skin_path'].$attrib['file']);
- if ($fsize = filesize($path)) {
+ if (is_readable($path)) {
if ($this->config['skin_include_php']) {
$incl = $this->include_php($path);
}
- else if ($fp = fopen($path, 'r')) {
- $incl = fread($fp, $fsize);
- fclose($fp);
- }
+ else {
+ $incl = file_get_contents($path);
+ }
return $this->parse_xml($incl);
}
break;