Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor view logic to permit JSON

  • Loading branch information...
commit 5ed89d042f6f4854c71ef24c644fbcc6a4b1aff5 1 parent 8f78169
@kaecyra kaecyra authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 library/core/class.controller.php
View
6 library/core/class.controller.php
@@ -858,11 +858,15 @@ public function FetchViewLocation($View = '', $ControllerName = false, $Applicat
$ViewPath = ViewLocation($View, $ControllerName, $ApplicationFolder);
// echo '<div>['.$LocationName.'] RETURNS ['.$ViewPath.']</div>';
- if (!StringBeginsWith($ViewPath, PATH_ROOT) || ($ViewPath === false && $ThrowError)) {
+ if ($ViewPath === false && $ThrowError) {
throw NotFoundException('View');
// trigger_error(ErrorMessage("Could not find a '$View' view for the '$ControllerName' controller in the '$ApplicationFolder' application.", $this->ClassName, 'FetchViewLocation'), E_USER_ERROR);
}
+ if ($ViewPath && !StringBeginsWith($ViewPath, PATH_ROOT)) {
+ throw NotFoundException('View');
+ }
+
return $ViewPath;
}
Please sign in to comment.
Something went wrong with that request. Please try again.