Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Changed "include" call to "file_get_contents" to eliminate php code f…
Browse files Browse the repository at this point in the history
…rom being evaluated.
  • Loading branch information
michaelchisari committed Mar 6, 2011
1 parent bff33b1 commit 68cee46
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions system/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ public function Display ( $pView = null, $pData = null) {
public function LoadView ( $pView ) {
eval ( GLOBALS );

// In case it was accidentally specified, remove the php extension from view name.
// In case it was accidentally specified, remove the php or html extension from view name.
$pView = str_replace ( '.php', '', $pView );
$pView = str_replace ( '.html', '', $pView );

$viewpath = $this->_GetViewPath ( $pView ) ;

if ( $viewpath ) {
ob_start ();
include ( $viewpath );
return ( ob_get_clean () );

if ( $return = file_get_contents ( $viewpath ) ) {
return ( $return );
}

return ( false );
Expand Down Expand Up @@ -106,11 +105,11 @@ private function _GetViewPath ( $pView = null ) {
$ThemeConfig = $Theme->Get ( "Config" );
$themepath = $ThemeConfig->GetPath();

$filename = $zApp->GetPath() . DS . 'components' . DS . $this->_Component . DS . 'views' . DS . $pView . '.php';
$filename = $zApp->GetPath() . DS . 'components' . DS . $this->_Component . DS . 'views' . DS . $pView . '.html';
if ( is_file ( $filename ) ) $return = $filename;

foreach ( $themepath as $t => $theme ) {
$filename = $zApp->GetPath() . DS . 'themes' . DS . $theme . DS . 'views' . DS . $this->_Component . DS . $pView . '.php';
$filename = $zApp->GetPath() . DS . 'themes' . DS . $theme . DS . 'views' . DS . $this->_Component . DS . $pView . '.html';
if ( is_file ( $filename ) ) $return = $filename;
}

Expand Down

0 comments on commit 68cee46

Please sign in to comment.