Merge branch 'develop' of https://github.com/getgrav/grav into 2.0

This commit is contained in:
Matias Griese
2017-11-17 08:04:41 +02:00
3 changed files with 12 additions and 0 deletions

View File

@@ -29,6 +29,8 @@
* Uri: Encode user and password to prevent issues in browsers
* Fixed "Invalid AJAX response" When using Built-in PHP Webserver in Windows [#1258](https://github.com/getgrav/grav-plugin-admin/issues/1258)
* Remove support for `config.user`, it was broken and bad practise
* Make sure that `clean cache` uses valid path [#1745](https://github.com/getgrav/grav/pull/1745)
* Fixed token creation issue with `Uri` params like `/id:3`
# v1.3.8
## 10/26/2017

View File

@@ -390,6 +390,7 @@ class Cache extends Getters
// Convert stream to a real path
try {
$path = $locator->findResource($stream, true, true);
if($path === false) continue;
$anything = false;
$files = glob($path . '/*');

View File

@@ -1143,11 +1143,20 @@ class Uri
*/
public static function addNonce($url, $action, $nonceParamName = 'nonce')
{
$fake = $url && $url[0] === '/';
if ($fake) {
$url = 'http://domain.com' . $url;
}
$uri = new static($url);
$parts = $uri->toArray();
$nonce = Utils::getNonce($action);
$parts['params'] = (isset($parts['params']) ? $parts['params'] : []) + [$nonceParamName => $nonce];
if ($fake) {
unset($parts['scheme'], $parts['host']);
}
return static::buildUrl($parts);
}