Daniel Rudolf
d3c624777f
Improve guessing whether URL rewriting is enabled
...
Besides searching for the env var 'PICO_URL_REWRITING', also try 'REDIRECT_PICO_URL_REWRITING'.
8 years ago
Daniel Rudolf
a2d0d745ff
Fix detection of Windows-based server environments
8 years ago
Daniel Rudolf
d9393df4fa
Pico::getBaseUrl(): Improve hostname detection with proxies
9 years ago
Daniel Rudolf
fb4bdfe1fc
Fix Pico::parseFileMeta() for non-YAML 1-liners
...
\Symfony\Component\Yaml\Parser::parse() returns the unchanged value when a 1-liner string which is no valid YAML is passed. Assume this string to be the page title. Thus the following page will work now:
```
---
This is the title
---
# Example page
{{ meta.title }} is going to be "This is the title" - or "%meta.title%" == "This is the title".
```
9 years ago
Daniel Rudolf
94279c57f8
Improve phpDocs class docs
9 years ago
Daniel Rudolf
6234be88b0
Always use `on404Content...` execution path when serving a 404.md
9 years ago
Daniel Rudolf
8dfb1b14c7
Improve HTTPS detection with proxies
...
Fixes #344 . Thanks @Robby-
Implementation details taken from Symfony 3.0.4, method \Symfony\Component\HttpFoundation\Request::isSecure(), see https://github.com/symfony/symfony/blob/v3.0.4/src/Symfony/Component/HttpFoundation/Request.php#L1169-L1192
9 years ago
Daniel Rudolf
bbd8ef8847
Fix Date meta header parsing with ISO-8601 datetime strings
...
Symfony YAML interprets ISO-8601 datetime strings and returns timestamps instead of the string. This behavior conforms to the YAML standard, i.e. this is no bug of Symfony YAML.
Fixes #336 . Thanks @csholmq for reporting this.
9 years ago
Daniel Rudolf
0a4e7443d2
Fix class doc typos
9 years ago
Daniel Rudolf
8426a53f63
Allow Pico::$requestFile to point to somewhere outside content_dir
...
Bugfix; Refactoring Pico::load404Content() and Pico::discoverCurrentPage()
9 years ago
Daniel Rudolf
a2aa46fd0e
Don't let dependant plugins automatically enable plugins which should be disabled by default
...
Follow-up to f10440b
and c0a7fdc
9 years ago
Daniel Rudolf
c0a7fdc801
Don't always check dependants of a disabled plugin
...
This isn't necessary because dependant plugins will check their dependencies on their own. Follow-up to f10440b
9 years ago
Daniel Rudolf
4f487b7ccf
AbstractPicoPlugin: Fix typos in exception message
9 years ago
Daniel Rudolf
f10440b996
Check dependencies when a plugin is enabled by default
9 years ago
Daniel Rudolf
d8be108c5b
Suppress PHP warning when using date_default_timezone_get()
...
Thanks to @nem25 for reporting this
10 years ago
Daniel Rudolf
1c2f6a1b23
Update class docs
10 years ago
Daniel Rudolf
73078a3dc3
Fix code formatting + class docs
10 years ago
Daniel Rudolf
c760205d70
Pico::triggerEvent(): Fix method docs typo
10 years ago
Daniel Rudolf
070da6d73f
Improve "404.md not found" exception message
10 years ago
Daniel Rudolf
5be2f8e597
Fix path handling on Windows
...
Fixes #307 ; thank you @bpgs for reporting!
10 years ago
Daniel Rudolf
43f953b67a
Pico::readPages(): Call Pico::parseFileMeta() again when a exception is thrown
10 years ago
Daniel Rudolf
3798cbe478
Remove page title fallback
10 years ago
Daniel Rudolf
329049bd18
Fix empty meta header
10 years ago
Daniel Rudolf
dc6ac516a8
Fix Pico::getPageUrl()
10 years ago
Daniel Rudolf
a138d23daf
Throw LogicException instead of RuntimeException in Pico::setConfig()
10 years ago
Daniel Rudolf
0c85d70820
Adding $queryData parameter to Pico::getPageUrl() method
...
This allows developers to easily add custom query data to an page URL without the need to check enabled URL rewriting on their own. Since Twigs `link` filter is just an alias for Pico::getPageUrl(), theme designers can do the same with e.g. `{{ "index"|link("foo=bar&baz=42") }}`.
Theme designers, heads up! Don't forget that the result of the `link` filter is never escaped, so the result could contain unescaped ampersands when passing custom query data. You should pass the result to Twigs `escape` filter when using custom query data.
10 years ago
Daniel Rudolf
93f7aaad8b
Class docs: Use default markdown table format
10 years ago
Daniel Rudolf
2ce422d907
PicoTwigExtension: Refactor error handling
10 years ago
Daniel Rudolf
9aaab5de1a
Refactor Pico::parseFileMeta()
10 years ago
Daniel Rudolf
5ea94d06e6
Catch YAML parse errors
10 years ago
Daniel Rudolf
2d9b5aa1a2
Fix operators
10 years ago
Daniel Rudolf
698a249d45
Force Pico::$requestUrl to have no leading/trailing slash
...
Fixes #291
10 years ago
Daniel Rudolf
2761f8b751
Refactor Pico::isUrlRewritingEnabled()
10 years ago
Daniel Rudolf
86d1f713f2
Move PHP version check to index.php
10 years ago
Daniel Rudolf
81821e7811
Improve Pico::getBaseUrl() code styling
10 years ago
theshka
1fae7ab3df
* [New] added PHP_VERSION check to Pico::run()
10 years ago
Daniel Rudolf
840d41bca5
Improve type hinting
10 years ago
Daniel Rudolf
c34afad4af
Fix typo
10 years ago
Daniel Rudolf
d252df4b98
Throw RuntimeException on invalid content dirs
10 years ago
Daniel Rudolf
f5006c036a
Prevent double slashes in base_url when installed to document root
...
Fixes #274
10 years ago
Daniel Rudolf
c72ea0ecec
PicoDeprecated: Sanitize content_dir and base_url options when reading config.php in Picos root dir
10 years ago
Daniel Rudolf
10de8efa11
Move markdown filter to PicoTwigExtension
10 years ago
Daniel Rudolf
f19adc64b9
Add PicoTwigExtension with map and sort_by filters
10 years ago
Daniel Rudolf
78ceabe878
Various improvements
...
- Reuse ParsedownExtra object
- Add new markdown Twig filter
- Improve class docs in general
- Document plugin number prefix usage
10 years ago
Daniel Rudolf
f9e9642c22
Fix Pico::getPageUrl()
...
With enabled URL rewriting we must call rawurlencode() on the file path parts rather the whole path
10 years ago
Daniel Rudolf
2ca711ad59
Add missing rawurlencode() to Pico::getPageUrl()
...
Replace urldecode() in Pico::evaluateRequestUrl() with rawurldecode()
See #272 for details, thanks @smcdougall for spotting!
10 years ago
Daniel Rudolf
cd7cd374bb
Add content filter to get the parsed contents of a page (lazy loading)
10 years ago
Daniel Rudolf
af8de56512
Fix typos
10 years ago
Daniel Rudolf
ccac8dd4d3
Force trailing slash of $config['base_url'] and force existance of $config['timezone']
10 years ago
Daniel Rudolf
90128f4946
Fix possible foreach on null errors
10 years ago