Browse Source

Fixing issue with how the check is done for determining if templatePath already terminates with subDir

Daren Sipes 8 years ago
parent
commit
4c3638fb98
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/View/View.php

+ 1 - 1
src/View/View.php

@@ -1249,7 +1249,7 @@ class View implements EventDispatcherInterface
         if (strlen($this->subDir)) {
             $subDir = $this->subDir . DIRECTORY_SEPARATOR;
             // Check if templatePath already terminates with subDir
-            if (strrpos($templatePath, $subDir) == strlen($templatePath) - strlen($subDir)) {
+            if ($templatePath != $subDir && substr($templatePath, -(strlen($subDir))) == $subDir) {
                 $subDir = '';
             }
         }