mirror of
https://github.com/getgrav/grav.git
synced 2026-07-10 06:53:47 +02:00
Merge branch 'develop' of https://github.com/getgrav/grav into 2.0
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 . '/*');
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user