Skip to content

Commit

Permalink
Merge branch 'release/1.7.40'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Mar 22, 2023
2 parents 8be02e4 + 1e27928 commit 685d762
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 11 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# v1.7.40
## 03/22/2023

1. [](#new)
* Added a new `timestamp: true|false` option for individual assets
1. [](#improved)
* Removed outdated `xcache` setting [#3615](https://github.com/getgrav/grav/pull/3615)
* Updated `robots.txt` [#3625](https://github.com/getgrav/grav/pull/3625)
1. [](#bugfix)
* Fixed `force_ssl` redirect in case of undefined hostname [#3702](https://github.com/getgrav/grav/pull/3702)
* Fixed an issue with duplicate identical page paths
* Fixed `BlueprintSchema:flattenData` to properly handle ignored fields
* Fixed LogViewer regex greediness [#3684](https://github.com/getgrav/grav/pull/3684)
* Fixed `whoami` command [#3695](https://github.com/getgrav/grav/pull/3695)

# v1.7.39.4
## 02/22/2023

Expand Down
11 changes: 8 additions & 3 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
User-agent: *
Disallow: /.github/
Disallow: /.phan/
Disallow: /assets/
Disallow: /backup/
Disallow: /bin/
Disallow: /cache/
Disallow: /grav/
Disallow: /logs/
Disallow: /system/
Disallow: /vendor/
Disallow: /tests/
Disallow: /tmp/
Disallow: /user/
Disallow: /vendor/
Disallow: /webserver-configs/
Allow: /user/pages/
Allow: /user/themes/
Allow: /user/images/
Allow: /
Allow: *.css$
Allow: *.js$
Allow: /system/*.js$
Allow: /system/*.js$
1 change: 0 additions & 1 deletion system/blueprints/config/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ form:
file: File
apc: APC
apcu: APCu
xcache: Xcache
memcache: Memcache
memcached: Memcached
wincache: WinCache
Expand Down
2 changes: 1 addition & 1 deletion system/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.7.39.4');
define('GRAV_VERSION', '1.7.40');
define('GRAV_SCHEMA', '1.7.0_2020-11-20_1');
define('GRAV_TESTING', false);

Expand Down
8 changes: 7 additions & 1 deletion system/src/Grav/Common/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ protected function addType($collection, $type, $asset, $options)
}

// Add timestamp
$options['timestamp'] = $this->timestamp;
$timestamp_override = $options['timestamp'] ?? true;

if (filter_var($timestamp_override, FILTER_VALIDATE_BOOLEAN)) {
$options['timestamp'] = $this->timestamp;
} else {
$options['timestamp'] = null;
}

// Set order
$group = $options['group'] ?? 'head';
Expand Down
1 change: 1 addition & 0 deletions system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ protected function renderQueryString($asset = null)
$querystring = '';

$asset = $asset ?? $this->asset;
$attributes = $this->attributes;

if (!empty($this->query)) {
if (Utils::contains($asset, '?')) {
Expand Down
3 changes: 2 additions & 1 deletion system/src/Grav/Common/Data/BlueprintSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public function flattenData(array $data, bool $includeAll = false, string $name
$items = $name !== '' ? $this->getProperty($name)['fields'] ?? [] : $this->items;
foreach ($items as $key => $rules) {
$type = $rules['type'] ?? '';
if (!str_starts_with($type, '_') && !str_contains($key, '*')) {
$ignore = (bool) array_filter((array)($rules['validate']['ignore'] ?? [])) ?? false;
if (!str_starts_with($type, '_') && !str_contains($key, '*') && $ignore !== true) {
$list[$prefix . $key] = null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Helpers/LogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class LogViewer
{
/** @var string */
protected $pattern = '/\[(?P<date>.*)\] (?P<logger>\w+).(?P<level>\w+): (?P<message>.*[^ ]+) (?P<context>[^ ]+) (?P<extra>[^ ]+)/';
protected $pattern = '/\[(?P<date>.*?)\] (?P<logger>\w+)\.(?P<level>\w+): (?P<message>.*[^ ]+) (?P<context>[^ ]+) (?P<extra>[^ ]+)/';

/**
* Get the objects of a tailed file
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Page/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ protected function getPagesPaths(): array
$dirs = (array) $grav['config']->get('system.pages.dirs', ['page://']);
foreach ($dirs as $dir) {
$path = $locator->findResource($dir);
if (file_exists($path)) {
if (file_exists($path) && !in_array($path, $paths, true)) {
$paths[] = $path;
}
}
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Scheduler/Scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ private function saveJobStates()
*/
public function whoami()
{
$process = new Process('whoami');
$process = new Process(['whoami']);
$process->run();

if ($process->isSuccessful()) {
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Service/PagesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function register(Container $container)
if ($config->get('system.force_ssl')) {
$scheme = $uri->scheme(true);
if ($scheme !== 'https') {
$url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$url = 'https://' . $uri->host() . $uri->uri();
$grav->redirect($url);
}
}
Expand Down

0 comments on commit 685d762

Please sign in to comment.