customizable page types

This commit is contained in:
Andy Miller
2015-04-10 13:21:03 -06:00
parent 7d16bafd52
commit 2a06dc9bea
2 changed files with 6 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ pages:
special_chars: # List of special characters to automatically convert to entities
'>': 'gt'
'<': 'lt'
types: 'txt|xml|html|json|rss|atom' # Pipe separated list of valid page types
cache:
enabled: true # Set to true to enable caching

View File

@@ -84,7 +84,11 @@ class Uri
// remove the extension if there is one set
$parts = pathinfo($uri);
if (preg_match("/\.(txt|xml|html|json|rss|atom)$/", $parts['basename'])) {
// set the original basename
$this->basename = $parts['basename'];
if (preg_match("/\.(".$config->get('system.pages.types').")$/", $parts['basename'])) {
$uri = rtrim($parts['dirname'], '/').'/'.$parts['filename'];
$this->extension = $parts['extension'];
}