Skip to content

Commit

Permalink
Closed security hole that could have allowed a file inclusion attack …
Browse files Browse the repository at this point in the history
…to occur.
  • Loading branch information
pointybeard authored and Alistair Kearney committed Dec 23, 2009
1 parent 02f8cd1 commit 5ecd4c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.php 100755 → 100644
Expand Up @@ -6,11 +6,17 @@
require(DOCROOT . '/symphony/lib/boot/bundle.php');

function renderer($mode='frontend'){
if(!in_array($mode, array('frontend', 'administration'))){
throw new Exception('Invalid Symphony Renderer mode specified. Must be either "frontend" or "administration".');
}
require_once(CORE . "/class.{$mode}.php");
return ($mode == 'administration' ? Administration::instance() : Frontend::instance());
}

$renderer = (isset($_GET['mode']) ? strtolower($_GET['mode']) : 'frontend');
$renderer = (isset($_GET['mode']) && strtolower($_GET['mode']) == 'administration'
? 'administration'
: 'frontend');

$output = renderer($renderer)->display(getCurrentPage());

header(sprintf('Content-Length: %d', strlen($output)));
Expand Down

0 comments on commit 5ecd4c0

Please sign in to comment.