From 989d080eb88666f382735b5cb4caa854c68fd2cb Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 12 Jun 2017 21:49:57 +0200 Subject: [PATCH 1/2] README.md: Explicitly use master branch for Travis badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc3592c..3047e2e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Pico [![License](https://picocms.github.io/badges/pico-license.svg)](https://github.com/picocms/Pico/blob/master/LICENSE.md) [![Version](https://picocms.github.io/badges/pico-version.svg)](https://github.com/picocms/Pico/releases/latest) -[![Build Status](https://api.travis-ci.org/picocms/Pico.svg)](https://travis-ci.org/picocms/Pico) +[![Build Status](https://api.travis-ci.org/picocms/Pico.svg?branch=master)](https://travis-ci.org/picocms/Pico) [![Freenode IRC Webchat](https://picocms.github.io/badges/pico-chat.svg)](https://webchat.freenode.net/?channels=%23picocms) Pico is a stupidly simple, blazing fast, flat file CMS. From d3c624777fcaee2583ee6da18567a98ba9eb5859 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Tue, 18 Jul 2017 21:36:15 +0200 Subject: [PATCH 2/2] Improve guessing whether URL rewriting is enabled Besides searching for the env var 'PICO_URL_REWRITING', also try 'REDIRECT_PICO_URL_REWRITING'. --- lib/Pico.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Pico.php b/lib/Pico.php index e40f8e2..a387b66 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -1284,7 +1284,14 @@ class Pico return $urlRewritingEnabled; } - $this->config['rewrite_url'] = (isset($_SERVER['PICO_URL_REWRITING']) && $_SERVER['PICO_URL_REWRITING']); + if (isset($_SERVER['PICO_URL_REWRITING'])) { + $this->config['rewrite_url'] = (bool) $_SERVER['PICO_URL_REWRITING']; + } elseif (isset($_SERVER['REDIRECT_PICO_URL_REWRITING'])) { + $this->config['rewrite_url'] = (bool) $_SERVER['REDIRECT_PICO_URL_REWRITING']; + } else { + $this->config['rewrite_url'] = false; + } + return $this->getConfig('rewrite_url'); }