Skip to content

Commit 685d762

Browse files
committed
Merge branch 'release/1.7.40'
2 parents 8be02e4 + 1e27928 commit 685d762

File tree

11 files changed

+38
-11
lines changed

11 files changed

+38
-11
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# v1.7.40
2+
## 03/22/2023
3+
4+
1. [](#new)
5+
* Added a new `timestamp: true|false` option for individual assets
6+
1. [](#improved)
7+
* Removed outdated `xcache` setting [#3615](https://github.com/getgrav/grav/pull/3615)
8+
* Updated `robots.txt` [#3625](https://github.com/getgrav/grav/pull/3625)
9+
1. [](#bugfix)
10+
* Fixed `force_ssl` redirect in case of undefined hostname [#3702](https://github.com/getgrav/grav/pull/3702)
11+
* Fixed an issue with duplicate identical page paths
12+
* Fixed `BlueprintSchema:flattenData` to properly handle ignored fields
13+
* Fixed LogViewer regex greediness [#3684](https://github.com/getgrav/grav/pull/3684)
14+
* Fixed `whoami` command [#3695](https://github.com/getgrav/grav/pull/3695)
15+
116
# v1.7.39.4
217
## 02/22/2023
318

robots.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
User-agent: *
2+
Disallow: /.github/
3+
Disallow: /.phan/
4+
Disallow: /assets/
25
Disallow: /backup/
36
Disallow: /bin/
47
Disallow: /cache/
5-
Disallow: /grav/
68
Disallow: /logs/
79
Disallow: /system/
8-
Disallow: /vendor/
10+
Disallow: /tests/
11+
Disallow: /tmp/
912
Disallow: /user/
13+
Disallow: /vendor/
14+
Disallow: /webserver-configs/
1015
Allow: /user/pages/
1116
Allow: /user/themes/
1217
Allow: /user/images/
1318
Allow: /
1419
Allow: *.css$
1520
Allow: *.js$
16-
Allow: /system/*.js$
21+
Allow: /system/*.js$

system/blueprints/config/system.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ form:
608608
file: File
609609
apc: APC
610610
apcu: APCu
611-
xcache: Xcache
612611
memcache: Memcache
613612
memcached: Memcached
614613
wincache: WinCache

system/defines.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// Some standard defines
1111
define('GRAV', true);
12-
define('GRAV_VERSION', '1.7.39.4');
12+
define('GRAV_VERSION', '1.7.40');
1313
define('GRAV_SCHEMA', '1.7.0_2020-11-20_1');
1414
define('GRAV_TESTING', false);
1515

system/src/Grav/Common/Assets.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,13 @@ protected function addType($collection, $type, $asset, $options)
268268
}
269269

270270
// Add timestamp
271-
$options['timestamp'] = $this->timestamp;
271+
$timestamp_override = $options['timestamp'] ?? true;
272+
273+
if (filter_var($timestamp_override, FILTER_VALIDATE_BOOLEAN)) {
274+
$options['timestamp'] = $this->timestamp;
275+
} else {
276+
$options['timestamp'] = null;
277+
}
272278

273279
// Set order
274280
$group = $options['group'] ?? 'head';

system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ protected function renderQueryString($asset = null)
192192
$querystring = '';
193193

194194
$asset = $asset ?? $this->asset;
195+
$attributes = $this->attributes;
195196

196197
if (!empty($this->query)) {
197198
if (Utils::contains($asset, '?')) {

system/src/Grav/Common/Data/BlueprintSchema.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ public function flattenData(array $data, bool $includeAll = false, string $name
129129
$items = $name !== '' ? $this->getProperty($name)['fields'] ?? [] : $this->items;
130130
foreach ($items as $key => $rules) {
131131
$type = $rules['type'] ?? '';
132-
if (!str_starts_with($type, '_') && !str_contains($key, '*')) {
132+
$ignore = (bool) array_filter((array)($rules['validate']['ignore'] ?? [])) ?? false;
133+
if (!str_starts_with($type, '_') && !str_contains($key, '*') && $ignore !== true) {
133134
$list[$prefix . $key] = null;
134135
}
135136
}

system/src/Grav/Common/Helpers/LogViewer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class LogViewer
2222
{
2323
/** @var string */
24-
protected $pattern = '/\[(?P<date>.*)\] (?P<logger>\w+).(?P<level>\w+): (?P<message>.*[^ ]+) (?P<context>[^ ]+) (?P<extra>[^ ]+)/';
24+
protected $pattern = '/\[(?P<date>.*?)\] (?P<logger>\w+)\.(?P<level>\w+): (?P<message>.*[^ ]+) (?P<context>[^ ]+) (?P<extra>[^ ]+)/';
2525

2626
/**
2727
* Get the objects of a tailed file

system/src/Grav/Common/Page/Pages.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ protected function getPagesPaths(): array
17741774
$dirs = (array) $grav['config']->get('system.pages.dirs', ['page://']);
17751775
foreach ($dirs as $dir) {
17761776
$path = $locator->findResource($dir);
1777-
if (file_exists($path)) {
1777+
if (file_exists($path) && !in_array($path, $paths, true)) {
17781778
$paths[] = $path;
17791779
}
17801780
}

system/src/Grav/Common/Scheduler/Scheduler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private function saveJobStates()
357357
*/
358358
public function whoami()
359359
{
360-
$process = new Process('whoami');
360+
$process = new Process(['whoami']);
361361
$process->run();
362362

363363
if ($process->isSuccessful()) {

system/src/Grav/Common/Service/PagesServiceProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function register(Container $container)
7272
if ($config->get('system.force_ssl')) {
7373
$scheme = $uri->scheme(true);
7474
if ($scheme !== 'https') {
75-
$url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
75+
$url = 'https://' . $uri->host() . $uri->uri();
7676
$grav->redirect($url);
7777
}
7878
}

0 commit comments

Comments
 (0)