Merge branch 'release/1.6.31'

This commit is contained in:
Andy Miller
2020-12-14 21:28:53 -07:00
9 changed files with 107 additions and 28 deletions

64
.github/workflows/build.yaml vendored Normal file
View File

@@ -0,0 +1,64 @@
name: Release Builds
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.1
extensions: opcache, gd
coverage: none
- name: Install Dependencies
run: |
sudo apt-get -y update -qq < /dev/null > /dev/null
sudo apt-get -y install -qq git zip < /dev/null > /dev/null
- name: Retrieval of Builder Scripts
run: |
# Real Grav URL
curl --silent -H "Authorization: token ${{ secrets.GLOBAL_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" ${{ secrets.BUILD_SCRIPT_URL }} --output build-grav.sh
# Development Local URL
# curl ${{ secrets.BUILD_SCRIPT_URL }} --output build-grav.sh
- name: Grav Builder
run: |
bash ./build-grav.sh
- name: Upload Grav Release Assets
id: upload-release-asset
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./grav-dist/*.zip"]'
slack:
name: Slack
needs: build
runs-on: ubuntu-latest
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: 8398a7/action-slack@v3
with:
status: failure
fields: repo,message,author,action
icon_emoji: ':octocat:'
author_name: 'Github Action Build'
text: '🚚 Automated Build Failure'
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: env.WORKFLOW_CONCLUSION == 'failure'

View File

@@ -7,7 +7,8 @@ on:
branches: [ develop ]
jobs:
test:
unit-tests:
runs-on: ${{ matrix.os }}
@@ -24,7 +25,10 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: opcache, gd
coverage: none
coverage: none
- name: Update composer
run: composer update
- name: Validate composer.json and composer.lock
run: composer validate
@@ -38,7 +42,7 @@ jobs:
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
@@ -46,21 +50,21 @@ jobs:
- name: Run test suite
run: vendor/bin/codecept run
- name: Slack Notification
uses: 8398a7/action-slack@v3
with:
status: custom
fields: workflow,job,commit,repo,ref,author,took
custom_payload: |
{
username: 'action-slack',
icon_emoji: ':octocat:',
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW}\n${process.env.AS_JOB} (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@${process.env.AS_REF} by ${process.env.AS_AUTHOR} succeeded in ${process.env.AS_TOOK}`,
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
if: always() # Pick up events even if the job fails or is canceled.
slack:
name: Slack
needs: unit-tests
runs-on: ubuntu-latest
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: 8398a7/action-slack@v3
with:
status: failure
fields: repo,message,author,action
icon_emoji: ':octocat:'
author_name: 'Github Action Tests'
text: '💥 Automated Test Failure'
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: env.WORKFLOW_CONCLUSION == 'failure'

1
.gitignore vendored
View File

@@ -44,3 +44,4 @@ tests/_support/_generated/*
tests/cache/*
tests/error.log
system/templates/testing/*
/user/config/versions.yaml

View File

@@ -6,8 +6,6 @@ php:
- '7.4'
branches:
only:
- develop
- master
- build_test
notifications:
email:

View File

@@ -1,3 +1,12 @@
# v1.6.31
## 12/14/2020
1. [](#improved)
* Allow all CSS and JS via `robots.txt` [#2006](https://github.com/getgrav/grav/issues/2006) [#3067](https://github.com/getgrav/grav/issues/3067)
1. [](#bugfix)
* Fixed `pages` field escaping issues, needs admin update, too [admin#1990](https://github.com/getgrav/grav-plugin-admin/issues/1990)
* Fix `svg-image` issue with classes applied to all elements [#3068](https://github.com/getgrav/grav/issues/3068)
# v1.6.30
## 12/03/2020

View File

@@ -11,3 +11,5 @@ Allow: /user/pages/
Allow: /user/themes/
Allow: /user/images/
Allow: /
Allow: *.css$
Allow: *.js$

View File

@@ -8,7 +8,7 @@
// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.6.30');
define('GRAV_VERSION', '1.6.31');
define('GRAV_TESTING', false);
define('DS', '/');

View File

@@ -688,7 +688,7 @@ class Pages
}
/**
* Get list of route/title of all pages.
* Get list of route/title of all pages. Title is in HTML.
*
* @param PageInterface $current
* @param int $level
@@ -721,10 +721,10 @@ class Pages
}
if ($showFullpath) {
$option = $current->route();
$option = htmlspecialchars($current->route());
} else {
$extra = $showSlug ? '(' . $current->slug() . ') ' : '';
$option = str_repeat('&mdash;-', $level). '&rtrif; ' . $extra . $current->title();
$option = str_repeat('&mdash;-', $level). '&rtrif; ' . $extra . htmlspecialchars($current->title());
}

View File

@@ -1477,12 +1477,13 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
$matched = false;
//Look for existing class
$svg = preg_replace_callback('/^<svg.*?(class=\"(.*?)").*>/', function($matches) use ($classes, &$matched) {
$svg = preg_replace_callback('/^<svg[^>]*(class=\")([^"]*)(\")[^>]*>/', function($matches) use ($classes, &$matched) {
if (isset($matches[2])) {
$new_classes = $matches[2] . $classes;
$matched = true;
return str_replace($matches[1], "class=\"$new_classes\"", $matches[0]);
}
return $matches[0];
}, $svg
);