summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/classes/request.php5
-rw-r--r--system/views/error.php94
2 files changed, 4 insertions, 95 deletions
diff --git a/system/classes/request.php b/system/classes/request.php
index dfe68f0..106697a 100644
--- a/system/classes/request.php
+++ b/system/classes/request.php
@@ -106,7 +106,10 @@ class Request {
$request = new Request();
$request->_post = $_POST;
$request->_get = $_GET;
- $url_parts = parse_url($_SERVER['REQUEST_URI']);
+ $uri = $_SERVER['REQUEST_URI'];
+ $basepath=Config::get('core.basepath','/');
+ $uri = preg_replace("#^{$basepath}index\.php#i", '', $uri);
+ $url_parts = parse_url($uri);
$request->route = Route::match($url_parts['path']);
$request->method=$_SERVER['REQUEST_METHOD'];
return $request;
diff --git a/system/views/error.php b/system/views/error.php
deleted file mode 100644
index 6204f35..0000000
--- a/system/views/error.php
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Error</title>
- <style>
- html{
- width:100%;
- min-height:100%;
- font-family:'Verdana';
- font-size:14px;
- }
- body{
-
- min-height:100%;
- background: #a90329; /* Old browsers */
- background: -moz-radial-gradient(center, ellipse cover, #a90329 0%, #6d0019 100%); /* FF3.6+ */
- background: -webkit-radial-gradient(center, ellipse cover, #a90329 0%,#6d0019 100%); /* Chrome10+,Safari5.1+ */
- }
- #content{
- width:1000px;
- margin:auto;
- padding:10px 0px;
- background:#eee;
- }
- .file{
- font-weight:bold;
- }
- .block{
- border-bottom:1px solid #000;
- margin:10px;
- }
- .code{
-
- padding:10px;
- }
- .highlight{
- background:#efecd0;
- }
- #exception{
- font-size:25px;
- font-weight:bold;
- padding:10px;
- }
-
- </style>
- </head>
- <body>
- <?php
- $rawblocks=array_merge(array(array(
- 'file'=>$exception->getFile(),
- 'line'=>$exception->getLine()
- )), $exception->getTrace());
- $blocks = array();
- foreach($rawblocks as $block){
- if(!isset($block['file']))
- continue;
- //avoid duplicates
- if(count($blocks)>0){
- $last=$blocks[count($blocks)-1];
- if($block['file']==$last['file'] && $block['line']==$last['line'])
- continue;
- }
- $blocks[]=$block;
- }
-
-
- ?>
- <div id="content">
- <div id="exception"><?php echo str_replace("\n",'<br/>',$exception->getMessage()); ?></div>
- <div id="blocks">
- <?php foreach($blocks as $block): ?>
- <div class="block">
- <div class="file"><?php echo $block['file'];?></div>
- <div class="code">
- <?php
- $line=$block['line']-1;
- $code = explode("\n", file_get_contents($block['file']));
- $start = $line - 3;
- if ($start < 0) $start = 0;
- $end = $line + 3;
- if($end>=count($code)) $end=count($code)-1;
- $code=array_slice($code,$start,$end-$start,true);
- ?>
-
- <?php foreach($code as $n=>$text):?>
- <pre class="line <?php echo $n==$line?'highlight':''; ?>"><?php echo ($n+1).' '.htmlspecialchars($text); ?></pre>
- <?php endforeach;?>
- </div>
- </div>
- <?php endforeach;?>
- </div>
- </div>
- </body>
-</html> \ No newline at end of file