Skip to content

Commit

Permalink
Added configurable blacklist for characters in directory names create…
Browse files Browse the repository at this point in the history
…d by static caching
  • Loading branch information
croxton committed Jul 27, 2016
1 parent 19a662b commit 304b0b0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
##Stash

![Release](https://img.shields.io/badge/release-3.0.2-brightgreen.svg)
![Release](https://img.shields.io/badge/release-3.0.3-brightgreen.svg)

Stash for ExpressionEngine 3.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -13,7 +13,7 @@
},
"extra": {
"branch-alias": {
"dev-dev": "2.6.*-dev"
"dev-dev": "2.7.*-dev"
}
}
}
2 changes: 1 addition & 1 deletion system/user/addons/stash/config.php
Expand Up @@ -2,7 +2,7 @@
if (! defined('STASH_VER'))
{
define('STASH_NAME', 'Stash');
define('STASH_VER', '3.0.2');
define('STASH_VER', '3.0.3');
define('STASH_AUTHOR', 'Mark Croxton, Hallmark Design');
define('STASH_AUTHOR_URL', 'http://hallmark-design.co.uk');
define('STASH_DOCS', 'http://github.com/croxton/Stash/');
Expand Down
11 changes: 11 additions & 0 deletions system/user/addons/stash/models/stash_model.php
Expand Up @@ -807,6 +807,17 @@ private function _path($uri = '/', $site_id)
return FALSE;
}

// Blacklist of characters we don't want to allow as directory names in the cache
$bad = ee()->config->item('stash_static_character_blacklist')
? (array) ee()->config->item('stash_static_character_blacklist')
: array(LD, RD, '<', '>', ':', '"', '\\', '|', '*', '.');
$new_uri = str_replace($bad, '', $uri);

if ($uri != $new_uri)
{
return FALSE;
}

// Build the path
return trim($path.'/'.$site_id.'/'.trim($uri, '/')).'/';
}
Expand Down

0 comments on commit 304b0b0

Please sign in to comment.