From 4cf5f00441a04acd25f228e630eb56a78a28824c Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 22 Aug 2017 11:22:13 -0600 Subject: [PATCH 01/37] Added natsort on plugin load #1614 --- CHANGELOG.md | 6 ++++++ system/src/Grav/Common/Plugins.php | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3fb0d136..79074f36a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.3.3 +## xx/xx/2017 + +1. [](#improved) + * Forced `natsort` on plugins to ensure consistent plugin load ordering across platforms [#1614](https://github.com/getgrav/grav/issues/1614) + # v1.3.2 ## 08/16/2017 diff --git a/system/src/Grav/Common/Plugins.php b/system/src/Grav/Common/Plugins.php index 340caf15d..25fb356ad 100644 --- a/system/src/Grav/Common/Plugins.php +++ b/system/src/Grav/Common/Plugins.php @@ -27,13 +27,18 @@ class Plugins extends Iterator $locator = Grav::instance()['locator']; $iterator = $locator->getIterator('plugins://'); - foreach ($iterator as $directory) { + + $plugins = []; + foreach($iterator as $directory) { if (!$directory->isDir()) { continue; } + $plugins[] = $directory->getBasename(); + } - $plugin = $directory->getBasename(); + natsort($plugins); + foreach ($plugins as $plugin) { $this->add($this->loadPlugin($plugin)); } } From 39af36977e88513115940409d93c031367e2ef67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9C=88=E7=88=B7?= Date: Tue, 22 Aug 2017 14:17:56 -0500 Subject: [PATCH 02/37] Quick Fix Summary issues (#1554) * Quick Fix Summary issues 1. Calculate the string size without any html tags, so now you can get exactly what you wanted length; 2. Support utf8 2 character widths characters, like Chinese, Japanese; 3. This is a quick dirty mod, some associated functions should be rethinked; * fix: Add an option to compatibel with old version Now, you can use page.summary(10) as normal, or page.summary(10, true) to ignore all html tags and medias * fit PS2R coding style * psr-2 reformated without assignment align --- system/src/Grav/Common/Page/Page.php | 73 +++++++++++++++++++--------- 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 2395697ba..1915f0ec7 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -116,7 +116,7 @@ class Page * Initializes the page instance variables based on a file * * @param \SplFileInfo $file The file information for the .md file that the page represents - * @param string $extension + * @param string $extension * * @return $this */ @@ -331,7 +331,8 @@ class Page $frontmatter_file = $this->path . '/' . $this->folder . '/frontmatter.yaml'; if (file_exists($frontmatter_file)) { $frontmatter_data = (array)Yaml::parse(file_get_contents($frontmatter_file)); - $this->header = (object)array_replace_recursive($frontmatter_data, (array)$this->header); + $this->header = (object)array_replace_recursive($frontmatter_data, + (array)$this->header); } // Process frontmatter with Twig if enabled if (Grav::instance()['config']->get('system.pages.frontmatter.process_twig') === true) { @@ -485,9 +486,11 @@ class Page * * @param int $size Max summary size. * + * @param boolean $textOnly Only count text size. + * * @return string */ - public function summary($size = null) + public function summary($size = null, $textOnly = false) { $config = (array)Grav::instance()['config']->get('site.summary'); if (isset($this->header->summary)) { @@ -501,11 +504,12 @@ class Page // Set up variables to process summary from page or from custom summary if ($this->summary === null) { - $content = $this->content(); + $content = $textOnly ? strip_tags($this->content()) : $this->content(); $summary_size = $this->summary_size; } else { - $content = $this->summary; - $summary_size = mb_strlen($this->summary); + $content = strip_tags($this->summary); + // Use mb_strwidth to deal with the 2 character widths characters + $summary_size = mb_strwidth($content, 'utf-8'); } // Return calculated summary based on summary divider's position @@ -514,7 +518,12 @@ class Page if (!in_array($format, ['short', 'long'])) { return $content; } elseif (($format === 'short') && isset($summary_size)) { - return mb_substr($content, 0, $summary_size); + // Use mb_strimwidth to slice the string + if (mb_strwidth($content, 'utf8') > $summary_size) { + return mb_strimwidth($content, 0, $summary_size); + } else { + return $content; + } } // Get summary size from site config's file @@ -530,6 +539,15 @@ class Page $size = 300; } + // Only return string but not html, wrap whatever html tag you want when using + if ($textOnly) { + if (mb_strwidth($content, 'utf-8') <= $size) { + return $content; + } + + return mb_strimwidth($content, 0, $size, '...', 'utf-8'); + } + $summary = Utils::truncateHTML($content, $size); return html_entity_decode($summary); @@ -590,7 +608,7 @@ class Page $process_markdown = $this->shouldProcess('markdown'); - $process_twig = $this->shouldProcess('twig') || $this->modularTwig() ; + $process_twig = $this->shouldProcess('twig') || $this->modularTwig(); $cache_enable = isset($this->header->cache_enable) ? $this->header->cache_enable : $config->get('system.cache.enabled', true); @@ -801,7 +819,7 @@ class Page * Get value from a page variable (used mostly for creating edit forms). * * @param string $name Variable name. - * @param mixed $default + * @param mixed $default * * @return mixed */ @@ -1078,7 +1096,7 @@ class Page public function toArray() { return [ - 'header' => (array)$this->header(), + 'header' => (array)$this->header(), 'content' => (string)$this->value('content') ]; } @@ -1486,9 +1504,9 @@ class Page foreach ($value as $property => $prop_value) { $prop_key = $key . ":" . $property; $this->metadata[$prop_key] = [ - 'name' => $prop_key, + 'name' => $prop_key, 'property' => $prop_key, - 'content' => htmlspecialchars($prop_value, ENT_QUOTES, 'UTF-8') + 'content' => htmlspecialchars($prop_value, ENT_QUOTES, 'UTF-8') ]; } } else { @@ -1497,7 +1515,7 @@ class Page if (in_array($key, $header_tag_http_equivs)) { $this->metadata[$key] = [ 'http_equiv' => $key, - 'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8') + 'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8') ]; } elseif ($key == 'charset') { $this->metadata[$key] = ['charset' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')]; @@ -1505,7 +1523,10 @@ class Page // if it's a social metadata with separator, render as property $separator = strpos($key, ':'); $hasSeparator = $separator && $separator < strlen($key) - 1; - $entry = ['name' => $key, 'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')]; + $entry = [ + 'name' => $key, + 'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8') + ]; if ($hasSeparator) { $entry['property'] = $key; @@ -1589,6 +1610,7 @@ class Page * Returns the canonical URL for a page * * @param bool $include_lang + * * @return string */ public function canonical($include_lang = true) @@ -1603,6 +1625,7 @@ class Page * @param bool $canonical true to return the canonical URL * @param bool $include_lang * @param bool $raw_route + * * @return string The url. */ public function url($include_host = false, $canonical = false, $include_lang = true, $raw_route = false) @@ -2327,7 +2350,7 @@ class Page * Helper method to return an ancestor page. * * @param string $url The url of the page - * @param bool $lookup Name of the parent folder + * @param bool $lookup Name of the parent folder * * @return \Grav\Common\Page\Page page you were looking for if it exists */ @@ -2343,7 +2366,7 @@ class Page * Helper method to return an ancestor page to inherit from. The current * page object is returned. * - * @param string $field Name of the parent folder + * @param string $field Name of the parent folder * * @return Page */ @@ -2355,11 +2378,12 @@ class Page return $inherited; } + /** * Helper method to return an ancestor field only to inherit from. The * first occurrence of an ancestor field will be returned if at all. * - * @param string $field Name of the parent folder + * @param string $field Name of the parent folder * * @return array */ @@ -2373,7 +2397,7 @@ class Page /** * Method that contains shared logic for inherited() and inheritedField() * - * @param string $field Name of the parent folder + * @param string $field Name of the parent folder * * @return array */ @@ -2383,11 +2407,12 @@ class Page /** @var Pages $pages */ $inherited = $pages->inherited($this->route, $field); - $inheritedParams = (array) $inherited->value('header.' . $field); - $currentParams = (array) $this->value('header.' . $field); - if($inheritedParams && is_array($inheritedParams)) { + $inheritedParams = (array)$inherited->value('header.' . $field); + $currentParams = (array)$this->value('header.' . $field); + if ($inheritedParams && is_array($inheritedParams)) { $currentParams = array_replace_recursive($inheritedParams, $currentParams); } + return [$inherited, $currentParams]; } @@ -2395,7 +2420,7 @@ class Page * Helper method to return a page. * * @param string $url the url of the page - * @param bool $all + * @param bool $all * * @return \Grav\Common\Page\Page page you were looking for if it exists */ @@ -2411,7 +2436,7 @@ class Page * Get a collection of pages in the current context. * * @param string|array $params - * @param boolean $pagination + * @param boolean $pagination * * @return Collection * @throws \InvalidArgumentException @@ -2747,7 +2772,7 @@ class Page // Reorder all moved pages. foreach ($siblings as $slug => $page) { - $order = intval(trim($page->order(),'.')); + $order = intval(trim($page->order(), '.')); $counter++; if ($order) { From 667c4340d86b534201f23633f1a77528417bc751 Mon Sep 17 00:00:00 2001 From: Eihrister Date: Wed, 23 Aug 2017 22:29:18 +0200 Subject: [PATCH 03/37] Changing back the default redirect code from 301 to 302. (#1619) --- system/config/system.yaml | 4 ++-- system/src/Grav/Common/Grav.php | 2 +- system/src/Grav/Common/Uri.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/system/config/system.yaml b/system/config/system.yaml index 382c496be..a6110c4a8 100644 --- a/system/config/system.yaml +++ b/system/config/system.yaml @@ -58,8 +58,8 @@ pages: etag: false # Set the etag header tag vary_accept_encoding: false # Add `Vary: Accept-Encoding` header redirect_default_route: false # Automatically redirect to a page's default route - redirect_default_code: 301 # Default code to use for redirects - redirect_trailing_slash: true # Handle automatically or 301 redirect a trailing / URL + redirect_default_code: 302 # Default code to use for redirects + redirect_trailing_slash: true # Handle automatically or 302 redirect a trailing / URL ignore_files: [.DS_Store] # Files to ignore in Pages ignore_folders: [.git, .idea] # Folders to ignore in Pages ignore_hidden: true # Ignore all Hidden files and folders diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php index ef2125e33..02c889f2c 100644 --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ -174,7 +174,7 @@ class Grav extends Container } if ($code === null) { - $code = $this['config']->get('system.pages.redirect_default_code', 301); + $code = $this['config']->get('system.pages.redirect_default_code', 302); } if (isset($this['session'])) { diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index bb95c77ec..45daf1a04 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -295,9 +295,9 @@ class Uri $uri = str_replace($setup_base, '', $uri); } - // If configured to, redirect trailing slash URI's with a 301 redirect + // If configured to, redirect trailing slash URI's with a 302 redirect if ($config->get('system.pages.redirect_trailing_slash', false) && $uri != '/' && Utils::endsWith($uri, '/')) { - $grav->redirect(str_replace($this->root, '', rtrim($uri, '/')), 301); + $grav->redirect(str_replace($this->root, '', rtrim($uri, '/')), 302); } // process params From 7a7ffd349213ff671db49b277c259204e1ebf1f4 Mon Sep 17 00:00:00 2001 From: iusvar Date: Wed, 23 Aug 2017 22:30:39 +0200 Subject: [PATCH 04/37] fix Twig dynamic translation (#1618) * fix Twig dynamic translation * fix Twig dynamic translation --- system/src/Grav/Common/Language/Language.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/src/Grav/Common/Language/Language.php b/system/src/Grav/Common/Language/Language.php index ae9546a22..3a34dadd0 100644 --- a/system/src/Grav/Common/Language/Language.php +++ b/system/src/Grav/Common/Language/Language.php @@ -374,6 +374,7 @@ class Language { if (is_array($args)) { $lookup = array_shift($args); + $languages = array_shift($args); } else { $lookup = $args; $args = []; From 04690ce20639b0518faa3399d6f77ee35be0ff89 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 24 Aug 2017 07:57:56 -0600 Subject: [PATCH 05/37] Use `multilevel` field to handle Asset Collections #1201 --- CHANGELOG.md | 1 + system/blueprints/config/system.yaml | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79074f36a..1a7ba8de3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#improved) * 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) # v1.3.2 ## 08/16/2017 diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index 9ed7a0753..ee093cf4a 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -806,10 +806,12 @@ form: type: bool assets.collections: - type: array + type: multilevel label: PLUGIN_ADMIN.COLLECTIONS placeholder_key: collection_name placeholder_value: collection_path + validate: + type: array errors: type: section From cc8a20537e7ecba555217781e6aa46c6c48a3b4a Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 24 Aug 2017 09:17:25 -0600 Subject: [PATCH 06/37] Added support for redis `password` option #1620 --- CHANGELOG.md | 1 + system/blueprints/config/system.yaml | 6 ++++++ system/src/Grav/Common/Cache.php | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a7ba8de3..ad1f06868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [](#improved) * 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) # v1.3.2 ## 08/16/2017 diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index ee093cf4a..33c98547e 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -616,6 +616,12 @@ form: help: PLUGIN_ADMIN.REDIS_PORT_HELP placeholder: "6379" + cache.redis.password: + type: text + size: small + label: PLUGIN_ADMIN.REDIS_PASSWORD + + twig: type: section diff --git a/system/src/Grav/Common/Cache.php b/system/src/Grav/Common/Cache.php index 6746ab359..254f6fdd0 100644 --- a/system/src/Grav/Common/Cache.php +++ b/system/src/Grav/Common/Cache.php @@ -240,6 +240,7 @@ class Cache extends Getters case 'redis': $redis = new \Redis(); $socket = $this->config->get('system.cache.redis.socket', false); + $password = $this->config->get('system.cache.redis.password', false); if ($socket) { $redis->connect($socket); @@ -248,6 +249,11 @@ class Cache extends Getters $this->config->get('system.cache.redis.port', 6379)); } + // Authenticate with password if set + if ($password && !$redis->auth($password)) { + throw new \RedisException('Redis authentication failed'); + } + $driver = new DoctrineCache\RedisCache(); $driver->setRedis($redis); break; From eecf9148817bb33ba94b131dd51d475cf8afc9d7 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 24 Aug 2017 09:23:15 -0600 Subject: [PATCH 07/37] Updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad1f06868..c3cc1c917 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,13 @@ ## xx/xx/2017 1. [](#improved) + * 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) +1. [](#bugfix) + * Fixed UTF8 2 character support in `Page::summary()` [#1554](https://github.com/getgrav/grav/issues/1554) + * Fixed dynamic Twig translation [#1618](https://github.com/getgrav/grav/issues/1618) # v1.3.2 ## 08/16/2017 From b7e1eb9d1b74c046f1b2295dca3b87261cee16f0 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 24 Aug 2017 09:26:43 -0600 Subject: [PATCH 08/37] Updated changelog again --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3cc1c917..dd49fe216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * 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) 1. [](#bugfix) * Fixed UTF8 2 character support in `Page::summary()` [#1554](https://github.com/getgrav/grav/issues/1554) * Fixed dynamic Twig translation [#1618](https://github.com/getgrav/grav/issues/1618) From 0543d997f6648a71c2bbdbdb71cd9a67e29fe3ee Mon Sep 17 00:00:00 2001 From: Chris Jung Date: Fri, 25 Aug 2017 18:44:59 +0200 Subject: [PATCH 09/37] Gregwar/Image supports gaussianBlur (#1623) Since grav uses the GD Adapter of Gregwar/Image and has no option to change it, this should be safe to implement, when the latest Version of the Lib is used. --- system/src/Grav/Common/Page/Medium/ImageMedium.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Page/Medium/ImageMedium.php b/system/src/Grav/Common/Page/Medium/ImageMedium.php index 8cfcb1017..23b5b3ce7 100644 --- a/system/src/Grav/Common/Page/Medium/ImageMedium.php +++ b/system/src/Grav/Common/Page/Medium/ImageMedium.php @@ -51,7 +51,7 @@ class ImageMedium extends Medium 'resize', 'forceResize', 'cropResize', 'crop', 'zoomCrop', 'negate', 'brightness', 'contrast', 'grayscale', 'emboss', 'smooth', 'sharp', 'edge', 'colorize', 'sepia', 'enableProgressive', - 'rotate', 'flip', 'fixOrientation' + 'rotate', 'flip', 'fixOrientation', 'gaussianBlur' ]; /** From d1b0f12e5bfef59d7594f70d1506bbf29e1e49e0 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 25 Aug 2017 10:47:32 -0600 Subject: [PATCH 10/37] Added `gaussianBlur` media method #1623 --- CHANGELOG.md | 2 ++ composer.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd49fe216..26b08ac00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.3.3 ## xx/xx/2017 +1. [](#new) + * Added `gaussianBlur` media method [#1623](https://github.com/getgrav/grav/pull/1623) 1. [](#improved) * 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) diff --git a/composer.json b/composer.json index 1b7056e79..64393678d 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "filp/whoops": "~2.0", "matthiasmullie/minify": "^1.3", "monolog/monolog": "~1.0", - "gregwar/image": "~2.0", + "gregwar/image": "2.*", "donatj/phpuseragentparser": "~0.3", "pimple/pimple": "~3.0", "rockettheme/toolbox": "~1.0", From 3eace662747bf68372f7504964a558ded82a4556 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 25 Aug 2017 16:40:10 -0600 Subject: [PATCH 11/37] Added 2fa authenticator check --- system/blueprints/user/account.yaml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/system/blueprints/user/account.yaml b/system/blueprints/user/account.yaml index 3d4d7cb78..768d879b6 100644 --- a/system/blueprints/user/account.yaml +++ b/system/blueprints/user/account.yaml @@ -66,6 +66,36 @@ form: default: 'en' help: PLUGIN_ADMIN.LANGUAGE_HELP + twofa_check: + type: conditional + condition: config.plugins.admin.twofa_enabled + + fields: + + twofa: + title: PLUGIN_ADMIN.2FA_TITLE + type: section + underline: true + + twofa_enabled: + type: toggle + label: PLUGIN_ADMIN.2FA_ENABLED + classes: twofa-toggle + highlight: 0 + default: 0 + options: + 1: PLUGIN_ADMIN.YES + 0: PLUGIN_ADMIN.NO + validate: + type: bool + + + twofa_secret: + type: 2fa_secret + outerclasses: 'twofa-secret' + label: PLUGIN_ADMIN.2FA_SECRET + help: PLUGIN_ADMIN.2FA_SECRET_HELP + security: title: PLUGIN_ADMIN.ACCESS_LEVELS type: section From 42d3b12b131a1704c8da30c572c533a57e51197e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 25 Aug 2017 18:42:57 -0600 Subject: [PATCH 12/37] moved from help to sublabel --- system/blueprints/user/account.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/blueprints/user/account.yaml b/system/blueprints/user/account.yaml index 768d879b6..d83b6845b 100644 --- a/system/blueprints/user/account.yaml +++ b/system/blueprints/user/account.yaml @@ -94,7 +94,8 @@ form: type: 2fa_secret outerclasses: 'twofa-secret' label: PLUGIN_ADMIN.2FA_SECRET - help: PLUGIN_ADMIN.2FA_SECRET_HELP + sublabel: PLUGIN_ADMIN.2FA_SECRET_HELP + security: title: PLUGIN_ADMIN.ACCESS_LEVELS From 299a6580502078bd430a0391c670e32f8e5ee6da Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 25 Aug 2017 18:43:28 -0600 Subject: [PATCH 13/37] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26b08ac00..3c573db12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#new) * Added `gaussianBlur` media method [#1623](https://github.com/getgrav/grav/pull/1623) + * Added support for 2-Factor Auth in admin profile 1. [](#improved) * 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) From d075c2925453635d49703bfbab1d70c28fa467dc Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sat, 26 Aug 2017 11:49:57 -0600 Subject: [PATCH 14/37] Added chunk_split() twig filter --- CHANGELOG.md | 3 ++- system/src/Grav/Common/Twig/TwigExtension.php | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c573db12..7f15db31a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ ## xx/xx/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 support for 2-Factor Auth in admin profile + * Added new `|chunk_split()` Twig filter 1. [](#improved) * 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) diff --git a/system/src/Grav/Common/Twig/TwigExtension.php b/system/src/Grav/Common/Twig/TwigExtension.php index d6f417376..ebd58c338 100644 --- a/system/src/Grav/Common/Twig/TwigExtension.php +++ b/system/src/Grav/Common/Twig/TwigExtension.php @@ -67,6 +67,8 @@ class TwigExtension extends \Twig_Extension new \Twig_SimpleFilter('*ize', [$this, 'inflectorFilter']), new \Twig_SimpleFilter('absolute_url', [$this, 'absoluteUrlFilter']), new \Twig_SimpleFilter('contains', [$this, 'containsFilter']), + new \Twig_SimpleFilter('chunk_split', [$this, 'chunkSplitFilter']), + new \Twig_SimpleFilter('defined', [$this, 'definedDefaultFilter']), new \Twig_SimpleFilter('ends_with', [$this, 'endsWithFilter']), new \Twig_SimpleFilter('fieldName', [$this, 'fieldNameFilter']), @@ -377,6 +379,19 @@ class TwigExtension extends \Twig_Extension return $array; } + /** + * Wrapper for chunk_split() function + * + * @param $value + * @param $chars + * @param string $split + * @return string + */ + public function chunkSplitFilter($value, $chars, $split = '-') + { + return chunk_split($value, $chars, $split); + } + /** * determine if a string contains another * From 535a3d9a83e622ee1a7c2151c91e1ce1a6674f12 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sat, 26 Aug 2017 18:39:05 -0600 Subject: [PATCH 15/37] return if not authenticated --- system/src/Grav/Common/User/User.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/src/Grav/Common/User/User.php b/system/src/Grav/Common/User/User.php index 7768d888b..9b2b45bdd 100644 --- a/system/src/Grav/Common/User/User.php +++ b/system/src/Grav/Common/User/User.php @@ -197,6 +197,10 @@ class User extends Data return false; } + if (!$this->authenticated) { + return false; + } + if (isset($this->state) && $this->state !== 'enabled') { return false; } From c52931e7fa573550764cb7586a81f2c440c6de25 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 27 Aug 2017 12:57:39 -0600 Subject: [PATCH 16/37] hilight for 2fa in account should be on `true` --- system/blueprints/user/account.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/blueprints/user/account.yaml b/system/blueprints/user/account.yaml index d83b6845b..29628c40a 100644 --- a/system/blueprints/user/account.yaml +++ b/system/blueprints/user/account.yaml @@ -81,7 +81,7 @@ form: type: toggle label: PLUGIN_ADMIN.2FA_ENABLED classes: twofa-toggle - highlight: 0 + highlight: 1 default: 0 options: 1: PLUGIN_ADMIN.YES From 3572833e7aebe8a209de1f3755387f8a368b742e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 28 Aug 2017 12:02:11 -0600 Subject: [PATCH 17/37] Revert "fix Twig dynamic translation (#1618)" This reverts commit 7a7ffd349213ff671db49b277c259204e1ebf1f4. --- system/src/Grav/Common/Language/Language.php | 1 - 1 file changed, 1 deletion(-) diff --git a/system/src/Grav/Common/Language/Language.php b/system/src/Grav/Common/Language/Language.php index 3a34dadd0..ae9546a22 100644 --- a/system/src/Grav/Common/Language/Language.php +++ b/system/src/Grav/Common/Language/Language.php @@ -374,7 +374,6 @@ class Language { if (is_array($args)) { $lookup = array_shift($args); - $languages = array_shift($args); } else { $lookup = $args; $args = []; From 550b51f77ad34a3a70b741b1f4c201e3c5469c93 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 28 Aug 2017 12:22:53 -0600 Subject: [PATCH 18/37] Added new `tl` filter/function to translate language #1618 This addresses issues with the PR. It uses a new twig filter that gives full access to the langauges->translate() function. --- system/src/Grav/Common/Twig/TwigExtension.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/system/src/Grav/Common/Twig/TwigExtension.php b/system/src/Grav/Common/Twig/TwigExtension.php index ebd58c338..a8878224c 100644 --- a/system/src/Grav/Common/Twig/TwigExtension.php +++ b/system/src/Grav/Common/Twig/TwigExtension.php @@ -92,6 +92,7 @@ class TwigExtension extends \Twig_Extension new \Twig_SimpleFilter('sort_by_key', [$this, 'sortByKeyFilter']), new \Twig_SimpleFilter('starts_with', [$this, 'startsWithFilter']), new \Twig_SimpleFilter('t', [$this, 'translate']), + new \Twig_SimpleFilter('tl', [$this, 'translateLanguage']), new \Twig_SimpleFilter('ta', [$this, 'translateArray']), new \Twig_SimpleFilter('truncate', ['\Grav\Common\Utils', 'truncate']), new \Twig_SimpleFilter('truncate_html', ['\Grav\Common\Utils', 'truncateHTML']), @@ -127,6 +128,7 @@ class TwigExtension extends \Twig_Extension new \Twig_SimpleFunction('regex_replace', [$this, 'regexReplace']), new \Twig_SimpleFunction('string', [$this, 'stringFunc']), new \Twig_simpleFunction('t', [$this, 'translate']), + new \Twig_simpleFunction('tl', [$this, 'translateLanguage']), new \Twig_simpleFunction('ta', [$this, 'translateArray']), new \Twig_SimpleFunction('url', [$this, 'urlFunc']), new \Twig_SimpleFunction('json_decode', [$this, 'jsonDecodeFilter']), @@ -610,6 +612,20 @@ class TwigExtension extends \Twig_Extension return $this->grav['language']->translate(func_get_args()); } + /** + * Translate Strings + * + * @param $args + * @param array|null $languages + * @param bool $array_support + * @param bool $html_out + * @return mixed + */ + public function translateLanguage($args, array $languages = null, $array_support = false, $html_out = false) + { + return $this->grav['language']->translate($args, $languages, $array_support, $html_out); + } + /** * @param $key * @param $index From 7a3f136207fa0cd621ff2409efed7cd62edda65f Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 28 Aug 2017 12:29:03 -0600 Subject: [PATCH 19/37] updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f15db31a..e5b01b365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * 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) 1. [](#improved) * 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) @@ -13,7 +14,6 @@ * Use 302 rather than 301 redirects by default [#1619](https://github.com/getgrav/grav/issues/1619) 1. [](#bugfix) * Fixed UTF8 2 character support in `Page::summary()` [#1554](https://github.com/getgrav/grav/issues/1554) - * Fixed dynamic Twig translation [#1618](https://github.com/getgrav/grav/issues/1618) # v1.3.2 ## 08/16/2017 From 0179c6ee65c1083783a845b46eceb410f2b9af63 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 31 Aug 2017 21:58:20 -0600 Subject: [PATCH 20/37] blueprint alignment --- system/blueprints/config/system.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index 33c98547e..e8bcfd70b 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -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: From 9147a10cc7810d247b485fe4bfb49623f521cd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Tue, 5 Sep 2017 21:57:17 +0200 Subject: [PATCH 21/37] Add try to load alphanumeric class (#1630) --- system/src/Grav/Common/GPM/Installer.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/src/Grav/Common/GPM/Installer.php b/system/src/Grav/Common/GPM/Installer.php index 770e7c8c2..eadc6501a 100644 --- a/system/src/Grav/Common/GPM/Installer.php +++ b/system/src/Grav/Common/GPM/Installer.php @@ -238,6 +238,12 @@ class Installer 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; } From 8532c2d06e598ae12ba7b175b7eb7c309db7bc0f Mon Sep 17 00:00:00 2001 From: Mike Mellor Date: Tue, 5 Sep 2017 20:57:32 +0100 Subject: [PATCH 22/37] Added current position to page object (#1632) --- system/src/Grav/Common/Page/Page.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 1915f0ec7..d3e25a262 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2269,6 +2269,23 @@ class Page 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. From 96028d1d6971dc6669c3921cae83c94a46657b23 Mon Sep 17 00:00:00 2001 From: j000 Date: Tue, 5 Sep 2017 21:57:46 +0200 Subject: [PATCH 23/37] Fix setting session cookie twice (#1634) Because setting cookie twice bothers me. Now proper options are applied to first one, so no need to set it again. --- system/src/Grav/Common/Session.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Session.php b/system/src/Grav/Common/Session.php index 67aaab5ae..fc9e66b42 100644 --- a/system/src/Grav/Common/Session.php +++ b/system/src/Grav/Common/Session.php @@ -83,8 +83,9 @@ class Session extends BaseSession $session_name .= '-admin'; } $this->setName($session_name); + ini_set('session.cookie_secure', $secure); + ini_set('session.cookie_httponly', $httponly); $this->start(); - setcookie(session_name(), session_id(), $session_timeout ? time() + $session_timeout : 0, $session_path, $domain, $secure, $httponly); } } From 481fe1903e73d1bc1bc98ec74e4bb1b23a7b3e94 Mon Sep 17 00:00:00 2001 From: Antony Dabonde Date: Wed, 6 Sep 2017 05:58:57 +1000 Subject: [PATCH 24/37] Added system option to enable case insensitive urls. (#1638) --- system/blueprints/config/system.yaml | 11 +++++++++++ system/src/Grav/Common/Uri.php | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index e8bcfd70b..ccfa60a7e 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -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 diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index 45daf1a04..eb714897e 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -286,6 +286,11 @@ class Uri $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); From 8d64835765624e50201a30be283b621bb677713c Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 5 Sep 2017 21:08:50 -0600 Subject: [PATCH 25/37] updated vendor libs --- composer.lock | 212 +++++++++++++++++++++++++------------------------- 1 file changed, 108 insertions(+), 104 deletions(-) diff --git a/composer.lock b/composer.lock index 063b647ae..d8a3870ad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "550adaab2ad1daea868cb5568ccbe19d", + "content-hash": "41f164834e93461a28778cbcd4e6ce05", "packages": [ { "name": "antoligy/dom-string-iterators", @@ -52,33 +52,37 @@ }, { "name": "doctrine/cache", - "version": "v1.6.2", + "version": "v1.7.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" + "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", + "url": "https://api.github.com/repos/doctrine/cache/zipball/b3217d58609e9c8e661cd41357a54d926c4a2a1a", + "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a", "shasum": "" }, "require": { - "php": "~5.5|~7.0" + "php": "~7.1" }, "conflict": { "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" + "alcaeus/mongo-php-adapter": "^1.1", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^5.7", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -118,7 +122,7 @@ "cache", "caching" ], - "time": "2017-07-22T12:49:21+00:00" + "time": "2017-08-25T07:02:50+00:00" }, { "name": "doctrine/collections", @@ -641,16 +645,16 @@ }, { "name": "maximebf/debugbar", - "version": "1.13.1", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "afee79a236348e39a44cb837106b7c5b4897ac2a" + "reference": "e23a98f2d65607d8aa6c7b409a513f8fdf4acdde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/afee79a236348e39a44cb837106b7c5b4897ac2a", - "reference": "afee79a236348e39a44cb837106b7c5b4897ac2a", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/e23a98f2d65607d8aa6c7b409a513f8fdf4acdde", + "reference": "e23a98f2d65607d8aa6c7b409a513f8fdf4acdde", "shasum": "" }, "require": { @@ -669,7 +673,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.14-dev" } }, "autoload": { @@ -698,7 +702,7 @@ "debug", "debugbar" ], - "time": "2017-01-05T08:46:19+00:00" + "time": "2017-08-17T07:17:00+00:00" }, { "name": "miljar/php-exif", @@ -981,16 +985,16 @@ }, { "name": "rockettheme/toolbox", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/rockettheme/toolbox.git", - "reference": "1be0986127007c9691345729607f94ba0e8a5120" + "reference": "670ad362eb948d14ebc589b957965cf178674a33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rockettheme/toolbox/zipball/1be0986127007c9691345729607f94ba0e8a5120", - "reference": "1be0986127007c9691345729607f94ba0e8a5120", + "url": "https://api.github.com/repos/rockettheme/toolbox/zipball/670ad362eb948d14ebc589b957965cf178674a33", + "reference": "670ad362eb948d14ebc589b957965cf178674a33", "shasum": "" }, "require": { @@ -1025,7 +1029,7 @@ "php", "rockettheme" ], - "time": "2017-05-22T13:09:53+00:00" + "time": "2017-08-28T20:31:35+00:00" }, { "name": "seld/cli-prompt", @@ -1077,16 +1081,16 @@ }, { "name": "symfony/console", - "version": "v2.8.26", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "32a3c6b3398de5db8ed381f4ef92970c59c2fcdd" + "reference": "c0807a2ca978e64d8945d373a9221a5c35d1a253" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/32a3c6b3398de5db8ed381f4ef92970c59c2fcdd", - "reference": "32a3c6b3398de5db8ed381f4ef92970c59c2fcdd", + "url": "https://api.github.com/repos/symfony/console/zipball/c0807a2ca978e64d8945d373a9221a5c35d1a253", + "reference": "c0807a2ca978e64d8945d373a9221a5c35d1a253", "shasum": "" }, "require": { @@ -1134,7 +1138,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:26:04+00:00" + "time": "2017-08-27T14:29:03+00:00" }, { "name": "symfony/debug", @@ -1195,7 +1199,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.26", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1255,16 +1259,16 @@ }, { "name": "symfony/polyfill-iconv", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "ae1347fa81423b67dbc232c8c111facb367ff8b9" + "reference": "1ea0e08453819ecc7130e1fb0ee10862c2f33ed0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/ae1347fa81423b67dbc232c8c111facb367ff8b9", - "reference": "ae1347fa81423b67dbc232c8c111facb367ff8b9", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/1ea0e08453819ecc7130e1fb0ee10862c2f33ed0", + "reference": "1ea0e08453819ecc7130e1fb0ee10862c2f33ed0", "shasum": "" }, "require": { @@ -1276,7 +1280,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -1310,20 +1314,20 @@ "portable", "shim" ], - "time": "2017-06-09T08:25:21+00:00" + "time": "2017-06-14T15:44:48+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", "shasum": "" }, "require": { @@ -1335,7 +1339,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -1369,20 +1373,20 @@ "portable", "shim" ], - "time": "2017-06-09T14:24:12+00:00" + "time": "2017-06-14T15:44:48+00:00" }, { "name": "symfony/var-dumper", - "version": "v2.8.26", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e9337f23b1c080df301d25b8891ecf1607b0b72f" + "reference": "83ebf3e92c0b2231fa63b8e584a2a3d3cd9876ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e9337f23b1c080df301d25b8891ecf1607b0b72f", - "reference": "e9337f23b1c080df301d25b8891ecf1607b0b72f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/83ebf3e92c0b2231fa63b8e584a2a3d3cd9876ef", + "reference": "83ebf3e92c0b2231fa63b8e584a2a3d3cd9876ef", "shasum": "" }, "require": { @@ -1437,11 +1441,11 @@ "debug", "dump" ], - "time": "2017-07-26T06:29:15+00:00" + "time": "2017-08-27T14:29:03+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.26", + "version": "v2.8.27", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -1711,32 +1715,32 @@ }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1761,7 +1765,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "facebook/webdriver", @@ -2102,22 +2106,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.2.2", + "version": "4.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^7.0", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.3.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -2143,20 +2147,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-08T06:39:58+00:00" + "time": "2017-08-30T18:51:59+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.3.0", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { @@ -2190,26 +2194,26 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-06-03T08:32:36+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -2220,7 +2224,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -2253,7 +2257,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-09-04T11:05:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3100,20 +3104,20 @@ }, { "name": "symfony/browser-kit", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0" + "reference": "aee7120b058c268363e606ff5fe8271da849a1b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", - "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/aee7120b058c268363e606ff5fe8271da849a1b5", + "reference": "aee7120b058c268363e606ff5fe8271da849a1b5", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/dom-crawler": "~2.8|~3.0" }, "require-dev": { @@ -3153,24 +3157,24 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-07-12T13:03:20+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "symfony/css-selector", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "4d882dced7b995d5274293039370148e291808f2" + "reference": "c5f5263ed231f164c58368efbce959137c7d9488" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/4d882dced7b995d5274293039370148e291808f2", - "reference": "4d882dced7b995d5274293039370148e291808f2", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/c5f5263ed231f164c58368efbce959137c7d9488", + "reference": "c5f5263ed231f164c58368efbce959137c7d9488", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { @@ -3206,24 +3210,24 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01T15:01:29+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1" + "reference": "d15dfaf71b65bf3affb80900470caf4451a8217e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1", - "reference": "fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d15dfaf71b65bf3affb80900470caf4451a8217e", + "reference": "d15dfaf71b65bf3affb80900470caf4451a8217e", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { @@ -3262,24 +3266,24 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-05-25T23:10:31+00:00" + "time": "2017-08-15T13:31:09+00:00" }, { "name": "symfony/finder", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" + "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4", - "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", + "url": "https://api.github.com/repos/symfony/finder/zipball/b2260dbc80f3c4198f903215f91a1ac7fe9fe09e", + "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { @@ -3311,24 +3315,24 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-06-01T21:01:25+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "symfony/process", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" + "reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", + "url": "https://api.github.com/repos/symfony/process/zipball/b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0", + "reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { @@ -3360,7 +3364,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-13T13:05:09+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "webmozart/assert", From 0dd5d0851402e0556c55f2833487c9ecbbdf12b6 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 5 Sep 2017 21:17:09 -0600 Subject: [PATCH 26/37] Accidentally updated to Doctrine Cache 1.7, force 1.6 (for PHP5 compatibility) --- composer.json | 2 +- composer.lock | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 64393678d..df12d925e 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "symfony/event-dispatcher": "~2.8", "symfony/var-dumper": "~2.8", "symfony/polyfill-iconv": "~1.0", - "doctrine/cache": "~1.5", + "doctrine/cache": "1.6.*", "doctrine/collections": "1.3", "filp/whoops": "~2.0", "matthiasmullie/minify": "^1.3", diff --git a/composer.lock b/composer.lock index d8a3870ad..cacf1c64b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "41f164834e93461a28778cbcd4e6ce05", + "content-hash": "093b6264edbdec148beb6ee2461a5e72", "packages": [ { "name": "antoligy/dom-string-iterators", @@ -52,37 +52,33 @@ }, { "name": "doctrine/cache", - "version": "v1.7.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a" + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/b3217d58609e9c8e661cd41357a54d926c4a2a1a", - "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a", + "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", "shasum": "" }, "require": { - "php": "~7.1" + "php": "~5.5|~7.0" }, "conflict": { "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", - "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^5.7", - "predis/predis": "~1.0" - }, - "suggest": { - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + "phpunit/phpunit": "~4.8|~5.0", + "predis/predis": "~1.0", + "satooshi/php-coveralls": "~0.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -122,7 +118,7 @@ "cache", "caching" ], - "time": "2017-08-25T07:02:50+00:00" + "time": "2017-07-22T12:49:21+00:00" }, { "name": "doctrine/collections", From 82f3322d4010d7bcc589c516d98cc6c0eb6c5576 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 5 Sep 2017 21:20:49 -0600 Subject: [PATCH 27/37] Use PHP7 compatible instantiator --- composer.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index cacf1c64b..802c3b39f 100644 --- a/composer.lock +++ b/composer.lock @@ -1711,32 +1711,32 @@ }, { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -1761,7 +1761,7 @@ "constructor", "instantiate" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "facebook/webdriver", From 5e7d103eab6fa980f4652ad9a98862de96cfe17f Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 5 Sep 2017 21:22:00 -0600 Subject: [PATCH 28/37] Rolled back to PHP 5.6 compatible phpdocumentor libs --- composer.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index 802c3b39f..a02dad7c6 100644 --- a/composer.lock +++ b/composer.lock @@ -2102,22 +2102,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.1.1", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=5.5", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.4.0", + "phpdocumentor/type-resolver": "^0.3.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -2143,20 +2143,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30T18:51:59+00:00" + "time": "2017-08-08T06:39:58+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", "shasum": "" }, "require": { @@ -2190,7 +2190,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "time": "2017-06-03T08:32:36+00:00" }, { "name": "phpspec/prophecy", From 6fb8cd293a7e4fc58624ee81dfd0cf2bbde3a134 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 5 Sep 2017 21:29:27 -0600 Subject: [PATCH 29/37] Try PHP 7.1 as PHP 7.0 on travis is too old --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7c543eac5..178992323 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,8 @@ language: php php: - '5.5' - '5.6' - - '7.0' + # - '7.0' + - '7.1' branches: only: - develop From 942652ec2706718a2bc735b1d73d6751e35aea92 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 5 Sep 2017 21:53:49 -0600 Subject: [PATCH 30/37] Try explicit php7 version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 178992323..aa3c9f767 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: php php: - '5.5' - '5.6' - # - '7.0' + - '7.0.21' - '7.1' branches: only: From 2eb8690c2d43c471b12bea3abf3890b0636d5e03 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 7 Sep 2017 10:39:54 -0600 Subject: [PATCH 31/37] Added new basename filter --- CHANGELOG.md | 2 +- system/src/Grav/Common/Twig/TwigExtension.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5b01b365..a39bde199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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 `|chunk_split()` and `|basename` Twig filter * Added new `tl` Twig filter/function to spport specific translations [#1618](https://github.com/getgrav/grav/issues/1618) 1. [](#improved) * Added options to `Page::summary()` to support size without HTML tags [#1554](https://github.com/getgrav/grav/issues/1554) diff --git a/system/src/Grav/Common/Twig/TwigExtension.php b/system/src/Grav/Common/Twig/TwigExtension.php index a8878224c..5d08b1282 100644 --- a/system/src/Grav/Common/Twig/TwigExtension.php +++ b/system/src/Grav/Common/Twig/TwigExtension.php @@ -98,6 +98,7 @@ class TwigExtension extends \Twig_Extension 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'), ]; } @@ -1113,4 +1114,15 @@ class TwigExtension extends \Twig_Extension { return pathinfo($var); } + + /** + * Simple wrapper for basename() + * + * @param $var + * @return string + */ + public function basenameFilter($var) + { + return basename($var); + } } From 580dac1784e606649baf8a845970bbc15106be33 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 7 Sep 2017 10:43:28 -0600 Subject: [PATCH 32/37] Added new dirname filter --- CHANGELOG.md | 2 +- system/src/Grav/Common/Twig/TwigExtension.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a39bde199..929ec7b90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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()` and `|basename` Twig filter + * Added new `|chunk_split()`, `|basename`, and `|dirname` Twig filter * Added new `tl` Twig filter/function to spport specific translations [#1618](https://github.com/getgrav/grav/issues/1618) 1. [](#improved) * Added options to `Page::summary()` to support size without HTML tags [#1554](https://github.com/getgrav/grav/issues/1554) diff --git a/system/src/Grav/Common/Twig/TwigExtension.php b/system/src/Grav/Common/Twig/TwigExtension.php index 5d08b1282..e117f0136 100644 --- a/system/src/Grav/Common/Twig/TwigExtension.php +++ b/system/src/Grav/Common/Twig/TwigExtension.php @@ -99,7 +99,7 @@ class TwigExtension extends \Twig_Extension new \Twig_SimpleFilter('json_decode', [$this, 'jsonDecodeFilter']), new \Twig_SimpleFilter('array_unique', 'array_unique'), new \Twig_SimpleFilter('basename', 'basenameFilter'), - + new \Twig_SimpleFilter('dirname', 'dirnameFilter'), ]; } @@ -1125,4 +1125,9 @@ class TwigExtension extends \Twig_Extension { return basename($var); } + + public function dirnameFilter($var) + { + return dirname($var); + } } From 898ab989aa87c8517e8d83d257d6deba24a4e469 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 7 Sep 2017 13:07:08 -0600 Subject: [PATCH 33/37] Revert "Fix setting session cookie twice (#1634)" This reverts commit 96028d1d6971dc6669c3921cae83c94a46657b23. --- system/src/Grav/Common/Session.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/src/Grav/Common/Session.php b/system/src/Grav/Common/Session.php index fc9e66b42..67aaab5ae 100644 --- a/system/src/Grav/Common/Session.php +++ b/system/src/Grav/Common/Session.php @@ -83,9 +83,8 @@ class Session extends BaseSession $session_name .= '-admin'; } $this->setName($session_name); - ini_set('session.cookie_secure', $secure); - ini_set('session.cookie_httponly', $httponly); $this->start(); + setcookie(session_name(), session_id(), $session_timeout ? time() + $session_timeout : 0, $session_path, $domain, $secure, $httponly); } } From d0e57c8276978f4d42ce8a4adc76e5698a3ebee9 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 7 Sep 2017 14:00:46 -0600 Subject: [PATCH 34/37] Update LICENSE.txt --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 484793ad1..f7d4bb64c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -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 From cc61464be321e6545d4182b5cfe3139504d6c9c0 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 7 Sep 2017 14:26:10 -0600 Subject: [PATCH 35/37] Updated changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 929ec7b90..6b57807fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,18 @@ * 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()`, `|basename`, and `|dirname` Twig filter - * Added new `tl` Twig filter/function to spport specific translations [#1618](https://github.com/getgrav/grav/issues/1618) + * Added new `tl` Twig filter/function to support specific translations [#1618](https://github.com/getgrav/grav/issues/1618) 1. [](#improved) * 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) From 0aa36f3cb0326324c731793bd166f584e50aad10 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 7 Sep 2017 15:10:05 -0600 Subject: [PATCH 36/37] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b57807fd..45c27fec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * 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) From ccad6753366f50ecebc03eb5f50c7d0b0d3e293a Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 7 Sep 2017 18:06:39 -0600 Subject: [PATCH 37/37] Prepare for release --- CHANGELOG.md | 2 +- system/defines.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45c27fec8..57d9d2381 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.3.3 -## xx/xx/2017 +## 09/07/2017 1. [](#new) * Added support for 2-Factor Authentication in admin profile diff --git a/system/defines.php b/system/defines.php index 141b79341..2fd2f70f6 100644 --- a/system/defines.php +++ b/system/defines.php @@ -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', '/');