diff --git a/CHANGELOG.md b/CHANGELOG.md index 0daa37c..732b9a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ Released: - ``` * [Changed] Improve documentation +* [Fixed] Improve hostname detection with proxies +* [Fixed] Fix detection of Windows-based server environments +* [Removed] Remove Twitter links ``` ### Version 1.0.4 diff --git a/README.md b/README.md index f2849ed..fd05a72 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ Pico [![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) [![Freenode IRC Webchat](https://picocms.github.io/badges/pico-chat.svg)](https://webchat.freenode.net/?channels=%23picocms) -[![Tweet Button](https://cloud.githubusercontent.com/assets/640217/11483728/b0842918-976f-11e5-9185-d53261b3125b.png)](https://twitter.com/intent/tweet?text=Pico+is+a+stupidly+simple%2C+blazing+fast%2C+flat+file+CMS.+Visit+http%3A%2F%2Fpicocms.org+and+downlaod+%23picocms+today%21+via+%40gitpicocms&related=gitpicocms) Pico is a stupidly simple, blazing fast, flat file CMS. diff --git a/content-sample/_meta.md b/content-sample/_meta.md index faab0cf..42ba888 100644 --- a/content-sample/_meta.md +++ b/content-sample/_meta.md @@ -3,9 +3,6 @@ social: - title: Visit us on GitHub url: https://github.com/picocms/Pico icon: octocat - - title: Check us out on Twitter - url: https://twitter.com/gitpicocms - icon: birdy - title: Join us on Freenode IRC Webchat url: https://webchat.freenode.net/?channels=%23picocms icon: chat diff --git a/lib/Pico.php b/lib/Pico.php index c99ea64..0aed209 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -1618,6 +1618,10 @@ class Pico /** * Returns the base URL of this Pico instance * + * Security Notice: You MUST configure Pico's base URL explicitly when + * using the base URL in contexts that are potentially vulnerable to + * HTTP Host Header Injection attacks (e.g. when generating emails). + * * @return string the base url */ public function getBaseUrl() @@ -1637,9 +1641,14 @@ class Pico $protocol = 'https'; } - $this->config['base_url'] = - $protocol . "://" . $_SERVER['HTTP_HOST'] - . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\') . '/'; + $host = $_SERVER['SERVER_NAME']; + if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) { + $host = $_SERVER['HTTP_X_FORWARDED_HOST']; + } elseif (!empty($_SERVER['HTTP_HOST'])) { + $host = $_SERVER['HTTP_HOST']; + } + + $this->config['base_url'] = $protocol . "://" . $host . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\') . '/'; return $this->config['base_url']; } @@ -1954,7 +1963,7 @@ class Pico */ public function getAbsolutePath($path) { - if (strncasecmp(PHP_OS, 'WIN', 3) === 0) { + if (DIRECTORY_SEPARATOR === '\\') { if (preg_match('/^([a-zA-Z]:\\\\|\\\\\\\\)/', $path) !== 1) { $path = $this->getRootDir() . $path; } diff --git a/themes/default/font/LICENSE.txt b/themes/default/font/LICENSE.txt index 270e046..0e67558 100644 --- a/themes/default/font/LICENSE.txt +++ b/themes/default/font/LICENSE.txt @@ -20,4 +20,4 @@ Font license info License: SIL OFL 1.1 Homepage: http://fortawesome.github.com/Font-Awesome/ - Icons: menu, github-circled ("octocat"), twitter ("birdy"), chat + Icons: menu, github-circled ("octocat"), chat diff --git a/themes/default/font/fontello.eot b/themes/default/font/fontello.eot index 0d93cf8..ed72da0 100644 Binary files a/themes/default/font/fontello.eot and b/themes/default/font/fontello.eot differ diff --git a/themes/default/font/fontello.svg b/themes/default/font/fontello.svg index 181dad9..b48d933 100644 --- a/themes/default/font/fontello.svg +++ b/themes/default/font/fontello.svg @@ -1,18 +1,16 @@ -Copyright (C) 2016 by original authors @ fontello.com +Copyright (C) 2017 by original authors @ fontello.com - + - + - - - + \ No newline at end of file diff --git a/themes/default/font/fontello.ttf b/themes/default/font/fontello.ttf index fb11489..fedcbb7 100644 Binary files a/themes/default/font/fontello.ttf and b/themes/default/font/fontello.ttf differ diff --git a/themes/default/font/fontello.woff b/themes/default/font/fontello.woff index d37a536..41eaa45 100644 Binary files a/themes/default/font/fontello.woff and b/themes/default/font/fontello.woff differ diff --git a/themes/default/font/fontello.woff2 b/themes/default/font/fontello.woff2 index 38039ce..0cf1936 100644 Binary files a/themes/default/font/fontello.woff2 and b/themes/default/font/fontello.woff2 differ diff --git a/themes/default/fontello.css b/themes/default/fontello.css index e9a005e..ec40869 100644 --- a/themes/default/fontello.css +++ b/themes/default/fontello.css @@ -55,7 +55,6 @@ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ } -.icon-menu:before { content: '\f0c9'; } /* '' */ -.icon-octocat:before { content: '\f09b'; } /* '' */ -.icon-birdy:before { content: '\f099'; } /* '' */ .icon-chat:before { content: '\e800'; } /* '' */ +.icon-octocat:before { content: '\f09b'; } /* '' */ +.icon-menu:before { content: '\f0c9'; } /* '' */