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:
#	CHANGELOG.md
  • Loading branch information
mahagr committed Jul 4, 2017
2 parents ee07963 + 4b72383 commit a59fc7b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
1. [](#improved)
* Make it possible to include debug bar also into non-HTML responses

# v1.3.0-rc.5
## xx/xx/2017

1. [](#new)
* Setting `system.session.timeout` to 0 clears the session when the browser session ends [#1538](https://github.com/getgrav/grav/pull/1538)
* Created a `CODE_OF_CONDUCT.md` so everyone knows how to behave :)
1. [](#improved)
* Renamed new `media()` Twig function to `media_directory()` to avoid conflict with Page's `media` object
1. [](#bugfix)
* Fixed global media files disappearing after a reload [#1545](https://github.com/getgrav/grav/issues/1545)
* Fix for broken regex redirects/routes via `site.yaml`
* Sanitize the error message in the error handler page

# v1.3.0-rc.4
## 06/22/2017

Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Errors/SimplePageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function handle()
$vars = array(
"stylesheet" => file_get_contents($cssFile),
"code" => $code,
"message" => $message,
"message" => filter_var(rawurldecode($message), FILTER_SANITIZE_STRING),
);

$helper->setVariables($vars);
Expand Down
13 changes: 10 additions & 3 deletions system/src/Grav/Common/Page/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,19 @@ public function __construct($path)
{
$this->path = $path;

$this->__wakeup();
$this->init();
}

/**
* Initialize static variables on unserialize.
*/
public function __wakeup()
{
if (!isset(static::$global)) {
// Add fallback to global media.
static::$global = new GlobalMedia($path);
static::$global = new GlobalMedia();
}

$this->init();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions system/src/Grav/Common/Page/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ public function dispatch($route, $all = false, $redirect = true)
$site_redirects = $config->get("site.redirects");
if (is_array($site_redirects)) {
foreach ((array)$site_redirects as $pattern => $replace) {
$pattern = '#^' . preg_quote(ltrim($pattern, '^')) . '#';
$pattern = '#^' . str_replace('/', '\/', ltrim($pattern, '^')) . '#';
try {
$found = preg_replace($pattern, $replace, $source_url);
if ($found != $source_url) {
Expand All @@ -496,7 +496,7 @@ public function dispatch($route, $all = false, $redirect = true)
$site_routes = $config->get("site.routes");
if (is_array($site_routes)) {
foreach ((array)$site_routes as $pattern => $replace) {
$pattern = '#^' . preg_quote(ltrim($pattern, '^')) . '#';
$pattern = '#^' . str_replace('/', '\/', ltrim($pattern, '^')) . '#';
try {
$found = preg_replace($pattern, $replace, $source_url);
if ($found != $source_url) {
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function init()
}
$this->setName($session_name);
$this->start();
setcookie(session_name(), session_id(), time() + $session_timeout, $session_path, $domain, $secure, $httponly);
setcookie(session_name(), session_id(), $session_timeout ? time() + $session_timeout : 0, $session_path, $domain, $secure, $httponly);
}
}

Expand Down

0 comments on commit a59fc7b

Please sign in to comment.