From 7ab0aee44aa382e2d98ba5c85b9250009e16e503 Mon Sep 17 00:00:00 2001 From: Pia Mancini Date: Wed, 15 Feb 2017 15:14:51 -0800 Subject: [PATCH 1/8] add space for sponsor's logo's to show inline (#1308) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ef5a74569..901544c86 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ Support us with a monthly donation and help us continue our activities. [[Become # Sponsors Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/grav#sponsor)] + From 33a63de4f10b62b7d385ff9f9ad0d3953846fd94 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 15 Feb 2017 17:21:16 -0700 Subject: [PATCH 2/8] Fix for double extension during some redirects #1307 --- system/src/Grav/Common/Page/Pages.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index f8fb702c7..4e8614aec 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -345,9 +345,10 @@ class Pages $page = $this->dispatch($route, $all); } else { // Try Regex style redirects + $uri = $this->grav['uri']; $source_url = $url; - $extension = $this->grav['uri']->extension(); - if (isset($extension)) { + $extension = $uri->extension(); + if (isset($extension) && !Utils::endsWith($uri->url(), $extension)) { $source_url.= '.' . $extension; } From 724f24335a9ea44f614b9ae2a76766836985d8ce Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 15 Feb 2017 17:22:53 -0700 Subject: [PATCH 3/8] Updated changelog --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af53b6c95..93aa4783c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.1.17 +## xx/xx/2017 + +1. [](#bugfix) + * Fix for double extensions getting added during some redirects [#1307](https://github.com/getgrav/grav/issues/1307) + # v1.1.16 ## 02/10/2017 @@ -11,7 +17,7 @@ * Various code cleanups (return types, missing variables in doclbocks, etc.) 1. [](#bugfix) * Fix blueprints slug validation [https://github.com/getgrav/grav-plugin-admin/issues/955](https://github.com/getgrav/grav-plugin-admin/issues/955) - + # v1.1.15 ## 01/30/2017 From e2cc55a4e3294d5855d27c7a1ca3daa5d9a99185 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Thu, 16 Feb 2017 10:16:30 +0100 Subject: [PATCH 4/8] Fix syntax error in PHP 5.3. Move the version check before requiring the autoloaded deps --- CHANGELOG.md | 3 ++- index.php | 9 +++++---- system/defines.php | 1 - 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93aa4783c..334174275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#bugfix) * Fix for double extensions getting added during some redirects [#1307](https://github.com/getgrav/grav/issues/1307) + * Fix syntax error in PHP 5.3. Move the version check before requiring the autoloaded deps # v1.1.16 ## 02/10/2017 @@ -17,7 +18,7 @@ * Various code cleanups (return types, missing variables in doclbocks, etc.) 1. [](#bugfix) * Fix blueprints slug validation [https://github.com/getgrav/grav-plugin-admin/issues/955](https://github.com/getgrav/grav-plugin-admin/issues/955) - + # v1.1.15 ## 01/30/2017 diff --git a/index.php b/index.php index 8d8d2b62f..b7a100134 100644 --- a/index.php +++ b/index.php @@ -7,6 +7,7 @@ */ namespace Grav; +define('GRAV_PHP_MIN', '5.5.9'); // Ensure vendor libraries exist $autoload = __DIR__ . '/vendor/autoload.php'; @@ -23,13 +24,13 @@ if (PHP_SAPI == 'cli-server') { use Grav\Common\Grav; use RocketTheme\Toolbox\Event\Event; -// Register the auto-loader. -$loader = require_once $autoload; - if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) { die(sprintf('You are running PHP %s, but Grav needs at least PHP %s to run.', $ver, $req)); } +// Register the auto-loader. +$loader = require_once $autoload; + // Set timezone to default, falls back to system if php.ini not set date_default_timezone_set(@date_default_timezone_get()); @@ -50,6 +51,6 @@ $grav = Grav::instance( try { $grav->process(); } catch (\Exception $e) { - $grav->fireEvent('onFatalException', new Event(['exception' => $e])); + $grav->fireEvent('onFatalException', new Event(array('exception' => $e))); throw $e; } diff --git a/system/defines.php b/system/defines.php index d033a98d8..9f2975723 100644 --- a/system/defines.php +++ b/system/defines.php @@ -11,7 +11,6 @@ define('GRAV', true); define('GRAV_VERSION', '1.1.16'); define('GRAV_TESTING', false); define('DS', '/'); -define('GRAV_PHP_MIN', '5.5.9'); // Directories and Paths if (!defined('GRAV_ROOT')) { From a3ccae5915fa1db501b231dbf74a470bea93e4c0 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Thu, 16 Feb 2017 10:37:35 +0100 Subject: [PATCH 5/8] Fix GRAV_PHP_MIN for CLI --- system/defines.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/defines.php b/system/defines.php index 9f2975723..14993a8ae 100644 --- a/system/defines.php +++ b/system/defines.php @@ -12,6 +12,10 @@ define('GRAV_VERSION', '1.1.16'); define('GRAV_TESTING', false); define('DS', '/'); +if (!defined('GRAV_PHP_MIN')) { + define('GRAV_PHP_MIN', '5.5.9'); +} + // Directories and Paths if (!defined('GRAV_ROOT')) { define('GRAV_ROOT', str_replace(DIRECTORY_SEPARATOR, DS, getcwd())); From 14bde9f31f5cb2275f15bce406cb407cae05f374 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 17 Feb 2017 10:35:33 +0200 Subject: [PATCH 6/8] Fix Whoops displaying error page if there is PHP core warning or error (#980) --- CHANGELOG.md | 1 + system/src/Grav/Common/Errors/Errors.php | 3 +- .../src/Grav/Common/Errors/SystemFacade.php | 39 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 system/src/Grav/Common/Errors/SystemFacade.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 334174275..534bc5065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [](#bugfix) * Fix for double extensions getting added during some redirects [#1307](https://github.com/getgrav/grav/issues/1307) * Fix syntax error in PHP 5.3. Move the version check before requiring the autoloaded deps + * Fix Whoops displaying error page if there is PHP core warning or error (#980) # v1.1.16 ## 02/10/2017 diff --git a/system/src/Grav/Common/Errors/Errors.php b/system/src/Grav/Common/Errors/Errors.php index 49c79e452..b073f756f 100644 --- a/system/src/Grav/Common/Errors/Errors.php +++ b/system/src/Grav/Common/Errors/Errors.php @@ -20,7 +20,8 @@ class Errors $jsonRequest = $_SERVER && isset($_SERVER['HTTP_ACCEPT']) && $_SERVER['HTTP_ACCEPT'] == 'application/json'; // Setup Whoops-based error handler - $whoops = new \Whoops\Run; + $system = new SystemFacade; + $whoops = new \Whoops\Run($system); $verbosity = 1; diff --git a/system/src/Grav/Common/Errors/SystemFacade.php b/system/src/Grav/Common/Errors/SystemFacade.php new file mode 100644 index 000000000..3170a1233 --- /dev/null +++ b/system/src/Grav/Common/Errors/SystemFacade.php @@ -0,0 +1,39 @@ +whoopsShutdownHandler = $function; + register_shutdown_function([$this, 'handleShutdown']); + } + + /** + * Special case to deal with Fatal errors and the like. + */ + public function handleShutdown() + { + $error = $this->getLastError(); + + // Ignore core warnings and errors. + if ($error && !($error['type'] & (E_CORE_WARNING | E_CORE_ERROR))) { + $handler = $this->whoopsShutdownHandler; + $handler(); + } + } +} From b9424922a20869e1fd05d05f4211bfba286693d5 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 17 Feb 2017 10:38:05 +0200 Subject: [PATCH 7/8] Changelog update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 534bc5065..73041332c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 1. [](#bugfix) * Fix for double extensions getting added during some redirects [#1307](https://github.com/getgrav/grav/issues/1307) * Fix syntax error in PHP 5.3. Move the version check before requiring the autoloaded deps - * Fix Whoops displaying error page if there is PHP core warning or error (#980) + * Fix Whoops displaying error page if there is PHP core warning or error [Admin #980](https://github.com/getgrav/grav-plugin-admin/issues/980) # v1.1.16 ## 02/10/2017 From 50b355aaea57bf30f0bedde22c85148fbfb0f0e3 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 17 Feb 2017 14:57:48 -0700 Subject: [PATCH 8/8] 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 73041332c..c2996b161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.1.17 -## xx/xx/2017 +## 02/17/2017 1. [](#bugfix) * Fix for double extensions getting added during some redirects [#1307](https://github.com/getgrav/grav/issues/1307) diff --git a/system/defines.php b/system/defines.php index 14993a8ae..387435b35 100644 --- a/system/defines.php +++ b/system/defines.php @@ -8,7 +8,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.1.16'); +define('GRAV_VERSION', '1.1.17'); define('GRAV_TESTING', false); define('DS', '/');