Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/getgrav/grav into 2.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.json
#	composer.lock
#	system/src/Grav/Common/Twig/TwigExtension.php
  • Loading branch information
mahagr committed Sep 8, 2017
2 parents 8c32103 + f2898f9 commit c0e1e15
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ language: php
php:
- '5.5'
- '5.6'
- '7.0'
- '7.0.21'
- '7.1'
branches:
only:
- develop
Expand Down
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@
* Make it possible to include debug bar also into non-HTML responses

# v1.3.3
## xx/xx/2017
## 09/07/2017

1. [](#new)
* Added support for 2-Factor Authentication in admin profile
* Added `gaussianBlur` media method [#1623](https://github.com/getgrav/grav/pull/1623)
* Added new `|chunk_split()` Twig filter
* Added new `tl` Twig filter/function to spport specific translations [#1618](https://github.com/getgrav/grav/issues/1618)
* Added new `|chunk_split()`, `|basename`, and `|dirname` Twig filter
* Added new `tl` Twig filter/function to support specific translations [#1618](https://github.com/getgrav/grav/issues/1618)
1. [](#improved)
* User `authorization` now requires a check for `authenticated` - REQUIRED: `Login v2.4.0`
* Added options to `Page::summary()` to support size without HTML tags [#1554](https://github.com/getgrav/grav/issues/1554)
* Forced `natsort` on plugins to ensure consistent plugin load ordering across platforms [#1614](https://github.com/getgrav/grav/issues/1614)
* Use new `multilevel` field to handle Asset Collections [#1201](https://github.com/getgrav/grav-plugin-admin/issues/1201)
* Added support for redis `password` option [#1620](https://github.com/getgrav/grav/issues/1620)
* Use 302 rather than 301 redirects by default [#1619](https://github.com/getgrav/grav/issues/1619)
* GPM Installer will try to load alphanumeric version of the class if no standard class found [#1630](https://github.com/getgrav/grav/issues/1630)
* Add current page position to `User` class [#1632](https://github.com/getgrav/grav/issues/1632)
* Added option to enable case insensitive URLs [#1638](https://github.com/getgrav/grav/issues/1638)
* Updated vendor libraries
* Updated `travis.yml` to add support for PHP 7.1 as well as 7.0.21 for test suite
1. [](#bugfix)
* Fixed UTF8 2 character support in `Page::summary()` [#1554](https://github.com/getgrav/grav/issues/1554)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Grav
Copyright (c) 2017 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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"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",
"filp/whoops": "~2.0",
Expand Down
50 changes: 25 additions & 25 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 20 additions & 9 deletions system/blueprints/config/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ form:
help: PLUGIN_ADMIN.HOME_PAGE_HELP

home.hide_in_urls:
type: toggle
label: PLUGIN_ADMIN.HIDE_HOME_IN_URLS
help: PLUGIN_ADMIN.HIDE_HOME_IN_URLS_HELP
highlight: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
type: toggle
label: PLUGIN_ADMIN.HIDE_HOME_IN_URLS
help: PLUGIN_ADMIN.HIDE_HOME_IN_URLS_HELP
highlight: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool


pages.theme:
Expand Down Expand Up @@ -1163,6 +1163,17 @@ form:
validate:
type: bool

case_insensitive_urls:
type: toggle
label: PLUGIN_ADMIN.CASE_INSENSITIVE_URLS
highlight: 0
help: PLUGIN_ADMIN.CASE_INSENSITIVE_URLS_HELP
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

param_sep:
type: select
size: medium
Expand Down
2 changes: 1 addition & 1 deletion system/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.3.2');
define('GRAV_VERSION', '1.3.3');
//define('GRAV_TESTING', true);
define('DS', '/');

Expand Down
6 changes: 6 additions & 0 deletions system/src/Grav/Common/GPM/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ private static function loadInstaller($installer_file_folder, $is_install)
return $class_name;
}

$class_name_alphanumeric = preg_replace('/[^a-zA-Z0-9]+/', '', $class_name);

if (class_exists($class_name_alphanumeric)) {
return $class_name_alphanumeric;
}

return $installer;
}

Expand Down
17 changes: 17 additions & 0 deletions system/src/Grav/Common/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -2269,6 +2269,23 @@ public function adjacentSibling($direction = 1)

return false;
}

/**
* Returns the item in the current position.
*
* @param string $path the path the item
*
* @return Integer the index of the current page.
*/
public function currentPosition()
{
$collection = $this->parent()->collection('content', false);
if ($collection instanceof Collection) {
return $collection->currentPosition($this->path());
}

return true;
}

/**
* Returns whether or not this page is the currently active page requested via the URL.
Expand Down
19 changes: 18 additions & 1 deletion system/src/Grav/Common/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public function getFilters()
new \Twig_SimpleFilter('truncate_html', ['\Grav\Common\Utils', 'truncateHTML']),
new \Twig_SimpleFilter('json_decode', [$this, 'jsonDecodeFilter']),
new \Twig_SimpleFilter('array_unique', 'array_unique'),

new \Twig_SimpleFilter('basename', 'basenameFilter'),
new \Twig_SimpleFilter('dirname', 'dirnameFilter'),
];
}

Expand Down Expand Up @@ -1115,6 +1116,22 @@ public function pathinfoFunc($var)
return pathinfo($var);
}

/**
* Simple wrapper for basename()
*
* @param $var
* @return string
*/
public function basenameFilter($var)
{
return basename($var);
}

public function dirnameFilter($var)
{
return dirname($var);
}

/**
* Returns a nicer more readable number
*
Expand Down
5 changes: 5 additions & 0 deletions system/src/Grav/Common/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ public function init()

$this->url = $this->base . $this->uri;

// if case insensitive urls is enabled, lowercase the url
if( $grav['config']->get('system.case_insensitive_urls') ){
$this->url = strtolower($this->url);
}

// get any params and remove them
$uri = str_replace($this->root, '', $this->url);

Expand Down

0 comments on commit c0e1e15

Please sign in to comment.