Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use get_file_contents($filepath) instead of fread($fp, filesize($file…

…path))
  • Loading branch information...
commit 2116866547f0967ce249b6c53f0f74cb0756071f 1 parent 1d0bbc4
gbateson authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 mod/hotpot/template/default.php
View
5 mod/hotpot/template/default.php
@@ -8,14 +8,13 @@ function read_template($filename, $tag='temporary') {
$filepath = $this->parent->template_dirpath.DIRECTORY_SEPARATOR.$filename;
// try and open the template file
- if (!file_exists($filepath) || !$fp = fopen($filepath, "r")) {
+ if (!file_exists($filepath) || !is_readable($filepath)) {
$msg = 'Could not open the '.$this->parent->template_dir.' template file "'.$filepath.'"';
error($msg, $this->parent->course_homeurl);
}
// read in the template and close the file
- $this->$tag = fread($fp, filesize($filepath));
- fclose($fp);
+ $this->$tag = file_get_contents($filepath);
// expand the blocks and strings in the template
$this->expand_blocks($tag);
Please sign in to comment.
Something went wrong with that request. Please try again.