Commit 5bc34c02 authored by  JosephK's avatar JosephK

Grav 1.4.3

parent d41216c7
This diff is collapsed.
The MIT License (MIT)
Copyright (c) 2017 Grav
Copyright (c) 2018 Grav
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -86,7 +86,7 @@ $ bin/gpm update
We appreciate any contribution to Grav, whether it is related to bugs, grammar, or simply a suggestion or improvement! Please refer to the [Contributing guide](CONTRIBUTING.md) for more guidance on this topic.
## Security issues
If you discover a possible security issue related to Grav or one of its plugins, please send an email to the core team at contact@getgrav.org and we'll address it as soon as possible.
If you discover a possible security issue related to Grav or one of its plugins, please email the core team at contact@getgrav.org and we'll address it as soon as possible.
# Getting Started
......@@ -101,9 +101,11 @@ If you discover a possible security issue related to Grav or one of its plugins,
* Have a look at our [Basic Tutorial](https://learn.getgrav.org/basics/basic-tutorial)
* Dive into more [advanced](https://learn.getgrav.org/advanced) functions
* Learn about the [Grav CLI](https://learn.getgrav.org/cli-console/grav-cli)
* Review examples in the [Grav Cookbook](https://learn.getgrav.org/cookbook)
# Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/grav#backer)]
Support Grav with a monthly donation to help us continue development. [[Become a backer](https://opencollective.com/grav#backer)]
<a href="https://opencollective.com/grav/backer/0/website" target="_blank"><img src="https://opencollective.com/grav/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/grav/backer/1/website" target="_blank"><img src="https://opencollective.com/grav/backer/1/avatar.svg"></a>
......@@ -181,7 +183,7 @@ See [LICENSE](LICENSE.txt)
# Running Tests
First install the dev dependencies by running `composer update` from the Grav root.
Then `composer test` will run the Unit Tests, which should be always executed successfully on any site.
First install the dev dependencies by running `composer update` from the Grav root.
Then `composer test` will run the Unit Tests, which should be always executed successfully on any site.
Windows users should use the `composer test-windows` command.
You can also run a single unit test file, e.g. `composer test tests/unit/Grav/Common/AssetsTest.php`
No preview for this file type
......@@ -8,22 +8,25 @@
"require": {
"php": ">=5.5.9",
"twig/twig": "~1.24",
"erusev/parsedown": "~1.6",
"erusev/parsedown": "1.6.4",
"erusev/parsedown-extra": "~0.7",
"symfony/yaml": "~2.8",
"symfony/console": "~2.8",
"symfony/event-dispatcher": "~2.8",
"symfony/var-dumper": "~2.8",
"symfony/polyfill-iconv": "~1.0",
"doctrine/cache": "1.6.*",
"doctrine/cache": "^1.6",
"doctrine/collections": "1.3",
"psr/simple-cache": "^1.0",
"psr/http-message": "^1.0",
"guzzlehttp/psr7": "^1.4",
"filp/whoops": "~2.0",
"matthiasmullie/minify": "^1.3",
"monolog/monolog": "~1.0",
"gregwar/image": "2.*",
"donatj/phpuseragentparser": "~0.3",
"pimple/pimple": "~3.0",
"rockettheme/toolbox": "~1.0",
"pimple/pimple": "~3.2",
"rockettheme/toolbox": "~1.3",
"maximebf/debugbar": "~1.10",
"ext-mbstring": "*",
"ext-openssl": "*",
......@@ -40,6 +43,11 @@
"fzaninotto/faker": "^1.5",
"victorjonsson/markdowndocs": "dev-master"
},
"config": {
"platform": {
"php": "5.5.9"
}
},
"repositories": [
{
"type": "vcs",
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
/**
* @package Grav.Core
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
......@@ -17,7 +17,7 @@ if (!is_file($autoload)) {
if (PHP_SAPI == 'cli-server') {
if (!isset($_SERVER['PHP_CLI_ROUTER'])) {
die("PHP webserver requires a router to run Grav, please use: <pre>php -S {$_SERVER["SERVER_NAME"]}:{$_SERVER["SERVER_PORT"]} system/router.php</pre>");
die("PHP webserver requires a router to run Grav, please use: <pre>php -S {$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']} system/router.php</pre>");
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
body header {
background: #8552A2;
background: #3085EE;
}
body .left-panel {
......
......@@ -1131,34 +1131,33 @@ form:
label: PLUGIN_ADMIN.PWD_REGEX
help: PLUGIN_ADMIN.PWD_REGEX_HELP
wrapped_site:
intl_enabled:
type: toggle
label: PLUGIN_ADMIN.WRAPPED_SITE
highlight: 0
help: PLUGIN_ADMIN.WRAPPED_SITE_HELP
label: PLUGIN_ADMIN.INTL_ENABLED
highlight: 1
help: PLUGIN_ADMIN.INTL_ENABLED_HELP
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
absolute_urls:
wrapped_site:
type: toggle
label: PLUGIN_ADMIN.ABSOLUTE_URLS
label: PLUGIN_ADMIN.WRAPPED_SITE
highlight: 0
help: PLUGIN_ADMIN.ABSOLUTE_URLS_HELP
help: PLUGIN_ADMIN.WRAPPED_SITE_HELP
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
case_insensitive_urls:
absolute_urls:
type: toggle
label: PLUGIN_ADMIN.CASE_INSENSITIVE_URLS
label: PLUGIN_ADMIN.ABSOLUTE_URLS
highlight: 0
help: PLUGIN_ADMIN.CASE_INSENSITIVE_URLS_HELP
help: PLUGIN_ADMIN.ABSOLUTE_URLS_HELP
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
......@@ -1187,6 +1186,18 @@ form:
validate:
type: bool
force_lowercase_urls:
type: toggle
label: PLUGIN_ADMIN.FORCE_LOWERCASE_URLS
highlight: 1
default: 1
help: PLUGIN_ADMIN.FORCE_LOWERCASE_URLS_HELP
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
custom_base_url:
type: text
size: medium
......
......@@ -310,6 +310,31 @@ form:
toggleable: true
help: PLUGIN_ADMIN.APPEND_URL_EXT_HELP
routes_only:
type: section
title: PLUGIN_ADMIN.ROUTE_OVERRIDES
underline: true
fields:
header.routes.default:
type: text
toggleable: true
label: PLUGIN_ADMIN.ROUTE_DEFAULT
header.routes.canonical:
type: text
toggleable: true
label: PLUGIN_ADMIN.ROUTE_CANONICAL
header.routes.aliases:
type: array
toggleable: true
value_only: true
size: large
label: PLUGIN_ADMIN.ROUTE_ALIASES
admin_only:
type: section
title: PLUGIN_ADMIN.ADMIN_SPECIFIC_OVERRIDES
......
title: PLUGIN_ADMIN.MODULAR
@extends:
type: default
context: blueprints://pages
'@extends': default
form:
fields:
......@@ -13,35 +11,28 @@ form:
content:
fields:
modular_title:
type: spacer
title: Modular Setup
header.content.items:
type: select
type: text
label: PLUGIN_ADMIN.ITEMS
default: '@self.modular'
options:
'@self.modular': Modular Children
size: medium
header.content.order.by:
type: select
type: text
label: PLUGIN_ADMIN.ORDER_BY
default: date
options:
folder: PLUGIN_ADMIN.FOLDER
title: PLUGIN_ADMIN.TITLE
date: PLUGIN_ADMIN.DATE
default: PLUGIN_ADMIN.DEFAULT
placeholder: date
help:
size: small
header.content.order.dir:
type: select
type: text
label: PLUGIN_ADMIN.ORDER
default: desc
options:
asc: PLUGIN_ADMIN.ASCENDING
desc: PLUGIN_ADMIN.DESCENDING
header.process:
type: ignore
content:
type: ignore
header.media_orider:
type: ignore
help: '"desc" or "asc" are valid values'
placeholder: desc
size: small
......@@ -40,6 +40,7 @@ form:
type: password
size: large
label: PLUGIN_ADMIN.PASSWORD
autocomplete: new-password
validate:
required: false
message: PLUGIN_ADMIN.PASSWORD_VALIDATION_MESSAGE
......
......@@ -5,9 +5,11 @@ param_sep: ':' # Parameter separator, use ';'
wrapped_site: false # For themes/plugins to know if Grav is wrapped by another platform
reverse_proxy_setup: false # Running in a reverse proxy scenario with different webserver ports than proxy
force_ssl: false # If enabled, Grav forces to be accessed via HTTPS (NOTE: Not an ideal solution)
force_lowercase_urls: true # If you want to support mixed cased URLs set this to false
custom_base_url: '' # Set the base_url manually, e.g. http://yoursite.com/yourpath
username_regex: '^[a-z0-9_-]{3,16}$' # Only lowercase chars, digits, dashes, underscores. 3 - 16 chars
pwd_regex: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}' # At least one number, one uppercase and lowercase letter, and be at least 8+ chars
intl_enabled: true # Special logic for PHP International Extension (mod_intl)
languages:
supported: [] # List of languages supported. eg: [en, fr, de]
......@@ -23,7 +25,7 @@ home:
hide_in_urls: false # Hide the home route in URLs
pages:
theme: antimatter # Default theme (defaults to "antimatter" theme)
theme: quark # Default theme (defaults to "quark" theme)
order:
by: default # Order pages by "default", "alpha" or "date"
dir: asc # Default ordering direction, "asc" or "desc"
......@@ -130,6 +132,7 @@ media:
session:
enabled: true # Enable Session support
initialize: true # Initialize session from Grav (if false, plugin needs to start the session)
timeout: 1800 # Timeout in seconds
name: grav-site # Name prefix of the session cookie. Use alphanumeric, dashes or underscores only. Do not use dots in the session name
secure: false # Set session secure. If true, indicates that communication for this cookie must be over an encrypted transmission. Enable this only on sites that run exclusively on HTTPS
......
......@@ -2,14 +2,14 @@
/**
* @package Grav.Core
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.3.8');
//define('GRAV_TESTING', true);
define('GRAV_VERSION', '1.4.3');
define('GRAV_TESTING', false);
define('DS', '/');
if (!defined('GRAV_PHP_MIN')) {
......
......@@ -2,7 +2,7 @@
/**
* @package Grav.Core
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
......
......@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
......@@ -35,11 +35,15 @@ class Assets
const CSS_URL_REGEX = '{url\(([\'\"]?)(.*?)\1\)}';
/** @const Regex to match CSS sourcemap comments */
const CSS_SOURCEMAP_REGEX = '{\/\*# (.*) \*\/}';
const CSS_SOURCEMAP_REGEX = '{\/\*# (.*?) \*\/}';
/** @const Regex to match CSS import content */
const CSS_IMPORT_REGEX = '{@import(.*);}';
const CSS_IMPORT_REGEX = '{@import(.*?);}';
/**
* @const Regex to match <script> or <style> tag when adding inline style/script. Note that this only supports a
* single tag, so the check is greedy to avoid issues in JS.
*/
const HTML_TAG_REGEX = '#(<([A-Z][A-Z0-9]*)>)+(.*)(<\/\2>)#is';
......@@ -613,7 +617,7 @@ class Assets
$inlineGroup = array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline';
$attributes = $this->attributes(array_merge(['type' => 'text/javascript'], $attributes));
$attributes = $this->attributes($attributes);
$output = '';
$inline_js = '';
......
......@@ -2,7 +2,7 @@
/**
* @package Grav.Common.Backup
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
......@@ -32,7 +32,7 @@ class ZipBackup
/**
* Backup
*
* @param null $destination
* @param string|null $destination
* @param callable|null $messager
*
* @return null|string
......@@ -107,18 +107,19 @@ class ZipBackup
* @param $exclusiveLength
* @param $messager
*/
private static function folderToZip($folder, \ZipArchive &$zipFile, $exclusiveLength, callable $messager = null)
private static function folderToZip($folder, \ZipArchive $zipFile, $exclusiveLength, callable $messager = null)
{
$handle = opendir($folder);
while (false !== $f = readdir($handle)) {
if ($f != '.' && $f != '..') {
if ($f !== '.' && $f !== '..') {
$filePath = "$folder/$f";
// Remove prefix from file path before add to zip.
$localPath = substr($filePath, $exclusiveLength);
if (in_array($f, static::$ignoreFolders)) {
continue;
} elseif (in_array($localPath, static::$ignorePaths)) {
}
if (in_array($localPath, static::$ignorePaths)) {
$zipFile->addEmptyDir($f);
continue;
}
......
......@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
......
......@@ -2,7 +2,7 @@
/**
* @package Grav.Common
*
* @copyright Copyright (C) 2014 - 2017 RocketTheme, LLC. All rights reserved.
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
......@@ -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;