Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/getgrav/grav into 2.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
mahagr committed Oct 13, 2017
2 parents c7be8eb + cc69591 commit 731fe50
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
1. [](#improved)
* Make it possible to include debug bar also into non-HTML responses

# v1.3.6
## 10/12/2017

1. [](#bugfix)
* Regression: Ajax error in Nginx [admin#1244](https://github.com/getgrav/grav-plugin-admin/issues/1244)
* Remove the `_url=$uri` portion of the the Nginx `try_files` command [admin#1244](https://github.com/getgrav/grav-plugin-admin/issues/1244)

# v1.3.5
## 10/11/2017

Expand Down
2 changes: 1 addition & 1 deletion system/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.3.5');
define('GRAV_VERSION', '1.3.6');
//define('GRAV_TESTING', true);
define('DS', '/');

Expand Down
7 changes: 7 additions & 0 deletions system/src/Grav/Common/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ protected function createFromEnvironment(array $env)
$this->query = parse_url('http://example.com' . $request_uri, PHP_URL_QUERY);
}

// Support ngnix routes.
if (strpos($this->query, '_url=') === 0) {
parse_str($this->query, $query);
unset($query['_url']);
$this->query = http_build_query($query);
}

// Build fragment.
$this->fragment = null;

Expand Down
23 changes: 23 additions & 0 deletions tests/unit/Grav/Common/UriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,29 @@ class UriTest extends \Codeception\TestCase\Test
'addNonce' => 'http://localhost/a-page.json/nonce:{{nonce}}',
'__toString' => 'http://localhost/a-page', // FIX ME <-
],
'http://localhost/admin/ajax.json/task:getnewsfeed' => [
'scheme' => 'http://',
'user' => null,
'password' => null,
'host' => 'localhost',
'port' => 80,
'path' => '/admin/ajax',
'query' => '',
'fragment' => null,

'route' => '/admin/ajax',
'paths' => ['admin', 'ajax'],
'params' => '/task:getnewsfeed',
'url' => '/admin/ajax',
'environment' => 'localhost',
'basename' => 'ajax.json',
'base' => 'http://localhost',
'currentPage' => 1,
'rootUrl' => 'http://localhost',
'extension' => 'json',
'addNonce' => 'http://localhost/admin/ajax.json/task:getnewsfeed/nonce:{{nonce}}',
'__toString' => 'http://localhost/admin/ajax/task:getnewsfeed',
],
'http://localhost/grav/admin/media.json/route:L1VzZXJzL3JodWsvd29ya3NwYWNlL2dyYXYtZGVtby1zYW1wbGVyL3VzZXIvYXNzZXRzL3FRMXB4Vk1ERTNJZzh5Ni5qcGc=/task:removeFileFromBlueprint/proute:/blueprint:Y29uZmlnL2RldGFpbHM=/type:config/field:deep.nested.custom_file/path:dXNlci9hc3NldHMvcVExcHhWTURFM0lnOHk2LmpwZw==' => [
'scheme' => 'http://',
'user' => null,
Expand Down
2 changes: 1 addition & 1 deletion webserver-configs/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ server {
# `location /subfolder {`
# and the rewrite to use `/subfolder/index.php`
location / {
try_files $uri $uri/ /index.php?_url=$uri&$query_string;
try_files $uri $uri/ /index.php?$query_string;
}
## End - Index

Expand Down

0 comments on commit 731fe50

Please sign in to comment.