Merge branch 'develop' of github.com:getgrav/grav into feature/blueprint-extend

* 'develop' of github.com:getgrav/grav:
  removed unneeded flags from reggae
  fix for dot files
  fix for path detection on windows [fix #194]
  Fix for issue #194 - query string handling
This commit is contained in:
Gert
2015-05-25 17:18:41 +02:00
2 changed files with 18 additions and 18 deletions

View File

@@ -557,7 +557,7 @@ class Pages
$last_modified = $modified;
}
if (Utils::endsWith($name, CONTENT_EXT)) {
if (preg_match('/^[^.].*'.CONTENT_EXT.'$/', $name)) {
$page->init($file);
$content_exists = true;

View File

@@ -74,15 +74,27 @@ class Uri
{
$config = Grav::instance()['config'];
// resets
$this->paths = [];
$this->params = [];
$this->query = [];
// get any params and remove them
$uri = str_replace($this->root, '', $this->url);
// reset params
$this->params = [];
// process params
$uri = $this->processParams($uri, $config->get('system.param_sep'));
// split the URL and params
$bits = parse_url($uri);
// process query string
if (isset($bits['query'])) {
parse_str($bits['query'], $this->query);
$uri = $bits['path'];
}
// remove the extension if there is one set
$parts = pathinfo($uri);
@@ -90,25 +102,13 @@ class Uri
$this->basename = $parts['basename'];
if (preg_match("/\.(".$config->get('system.pages.types').")$/", $parts['basename'])) {
$uri = rtrim($parts['dirname'], '/').'/'.$parts['filename'];
$uri = rtrim(str_replace(DIRECTORY_SEPARATOR, DS, $parts['dirname']), DS). '/' .$parts['filename'];
$this->extension = $parts['extension'];
}
// set the new url
$this->url = $this->root . $uri;
// split into bits
$this->bits = parse_url($uri);
$this->query = array();
if (isset($this->bits['query'])) {
parse_str($this->bits['query'], $this->query);
}
$path = $this->bits['path'];
$this->paths = array();
$this->path = $path;
$this->path = $uri;
$this->content_path = trim(str_replace($this->base, '', $this->path), '/');
if ($this->content_path != '') {
$this->paths = explode('/', $this->content_path);