Ⓜ️ Merge branch 'develop' into feature/introduce-testing

This commit is contained in:
Flavio Copes 2016-01-26 17:36:12 +01:00
commit bce084841e
7 changed files with 39 additions and 26 deletions

View File

@ -52,7 +52,7 @@ RewriteRule ^(user)/(.*)\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ error [F]
# Block all direct access to .md files:
RewriteRule \.md$ error [F]
# Block all direct access to files and folders beginning with a dot
RewriteRule (^\.|/\.) - [F]
RewriteRule (^|/)\.(?!well-known) - [F]
# Block access to specific files in the root folder
RewriteRule ^(LICENSE.txt|composer.lock|composer.json|\.htaccess)$ error [F]
## End - Security

View File

@ -7,7 +7,7 @@
"license": "MIT",
"require": {
"php": ">=5.5.9",
"twig/twig": "~1.23",
"twig/twig": "~1.24",
"erusev/parsedown-extra": "~0.7",
"symfony/yaml": "~2.8",
"symfony/console": "~2.8",

41
composer.lock generated
View File

@ -4,8 +4,13 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
<<<<<<< HEAD
"hash": "f3949adae9023c44601a49b7ba2ab1bf",
"content-hash": "ffe831b72cafb3b1bd1710931b1f8d46",
=======
"hash": "74323165a47899e7923dda8312cd7da7",
"content-hash": "f51f01081f7c3bbad68195491430c104",
>>>>>>> develop
"packages": [
{
"name": "doctrine/cache",
@ -843,16 +848,16 @@
},
{
"name": "symfony/polyfill-iconv",
"version": "v1.0.1",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-iconv.git",
"reference": "541cce29a46d6ee18bb9271c6ac3ca783b0faab0"
"reference": "be8627f0936f86fed0bec16fe79ebb4337299764"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/541cce29a46d6ee18bb9271c6ac3ca783b0faab0",
"reference": "541cce29a46d6ee18bb9271c6ac3ca783b0faab0",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/be8627f0936f86fed0bec16fe79ebb4337299764",
"reference": "be8627f0936f86fed0bec16fe79ebb4337299764",
"shasum": ""
},
"require": {
@ -864,7 +869,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "1.1-dev"
}
},
"autoload": {
@ -898,20 +903,20 @@
"portable",
"shim"
],
"time": "2015-11-20 09:19:13"
"time": "2016-01-20 09:13:37"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.0.1",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25"
"reference": "1289d16209491b584839022f29257ad859b8532d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25",
"reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d",
"reference": "1289d16209491b584839022f29257ad859b8532d",
"shasum": ""
},
"require": {
@ -923,7 +928,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "1.1-dev"
}
},
"autoload": {
@ -957,7 +962,7 @@
"portable",
"shim"
],
"time": "2015-11-20 09:19:13"
"time": "2016-01-20 09:13:37"
},
{
"name": "symfony/var-dumper",
@ -1073,16 +1078,16 @@
},
{
"name": "twig/twig",
"version": "v1.23.3",
"version": "v1.24.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "ae53fc2c312fdee63773b75cb570304f85388b08"
"reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/ae53fc2c312fdee63773b75cb570304f85388b08",
"reference": "ae53fc2c312fdee63773b75cb570304f85388b08",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8",
"reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8",
"shasum": ""
},
"require": {
@ -1095,7 +1100,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.23-dev"
"dev-master": "1.24-dev"
}
},
"autoload": {
@ -1130,7 +1135,7 @@
"keywords": [
"templating"
],
"time": "2016-01-11 14:02:19"
"time": "2016-01-25 21:22:18"
}
],
"packages-dev": [

File diff suppressed because one or more lines are too long

View File

@ -86,7 +86,7 @@ assets: # Configuration for Assets Manager (
js_minify: true # Minify the JS during pipelining
enable_asset_timestamp: false # Enable asset timestamps
collections:
jquery: system://assets/jquery/jquery-2.1.4.min.js
jquery: system://assets/jquery/jquery-2.x.min.js
errors:
display: false # Display full backtrace-style error page

View File

@ -138,8 +138,6 @@ class Page
$this->published();
$this->urlExtension();
// some extension logic
if (empty($extension)) {
$this->extension('.'.$file->getExtension());
@ -147,7 +145,6 @@ class Page
$this->extension($extension);
}
// extract page language from page extension
$language = trim(basename($this->extension(), 'md'), '.') ?: null;
$this->language($language);
@ -974,6 +971,10 @@ class Page
*/
public function urlExtension()
{
if ($this->home()) {
return '';
}
// if not set in the page get the value from system config
if (empty($this->url_extension)) {
$this->url_extension = trim(isset($this->header->append_url_extension) ? $this->header->append_url_extension : self::getGrav()['config']->get('system.pages.append_url_extension', false));

View File

@ -88,7 +88,7 @@ class User extends Data
// the result
Authentication::verify(
$password,
self::getGrav()['config']->get('system.security.default_hash', '$2y$10$kwsyMVwM8/7j0K/6LHT.g.Fs49xOCTp2b8hh/S5.dPJuJcJB6T.UK')
self::getGrav()['config']->get('system.security.default_hash')
);
return false;
} else {
@ -156,9 +156,12 @@ class User extends Data
//Check group access level
$groups = $this->get('groups');
if ($groups) foreach($groups as $group) {
if ($groups) foreach((array)$groups as $group) {
$permission = self::getGrav()['config']->get("groups.{$group}.access.{$action}");
$return = Utils::isPositive($permission);
if ($return === true) {
break;
}
}
//Check user access level