Permalink
Browse files

Clean up any trailing extensions on the route

  • Loading branch information...
kolber committed Apr 4, 2013
1 parent c2f808e commit 3bbe4c4aa6f3ab04ff369d1135b2418d988db0bc
Showing with 3 additions and 0 deletions.
  1. +3 −0 app/stacey.inc.php
View
@@ -127,6 +127,9 @@ function __construct($get) {
$key = preg_replace(array('/\/$/', '/^\//'), '', $key);
# store file path for this current page
$this->route = isset($key) ? $key : 'index';
+ # TODO: Relative root path is set incorrectly (missing an extra ../)
+ # strip any trailing extensions from the url
+ $this->route = preg_replace('/[\._][\w\d]+?$/', '', $this->route);
$file_path = Helpers::url_to_file_path($this->route);
try {

0 comments on commit 3bbe4c4

Please sign in to comment.