Skip to content

Commit

Permalink
Use DIRECTORY_SEPARATOR instead of '/'
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbennett committed Jun 6, 2016
1 parent 798f80c commit 76af5d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libraries/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getTemplate() {
public function render() {
$cwd = getcwd();
try {
chdir($cwd . "/templates");
chdir($cwd . DIRECTORY_SEPARATOR . "templates");
if (!file_exists($this->template)) {
throw new TemplateNotFoundException($this);
}
Expand All @@ -44,7 +44,8 @@ public function setContext(&$context) {
}

public function setTemplate($template) {
$this->template = "./" . $template . ".phtml";
$this->template = "." . DIRECTORY_SEPARATOR
. str_replace("/", DIRECTORY_SEPARATOR, $template) . ".phtml";
Logger::logMetric("template", $template);
}

Expand Down

0 comments on commit 76af5d5

Please sign in to comment.