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 e9573e1 commit 830f192
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##Stash

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

This is the development version of Stash. Test thoroughly before using in production.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
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/expressionengine/third_party/stash/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if (! defined('STASH_VER'))
{
define('STASH_NAME', 'Stash');
define('STASH_VER', '2.6.9');
define('STASH_VER', '2.7.0');
define('STASH_AUTHOR', 'Mark Croxton');
define('STASH_DOCS', 'http://github.com/croxton/Stash/');
define('STASH_DESC', 'Stash: save text and code snippets for reuse throughout your templates.');
Expand Down
11 changes: 11 additions & 0 deletions system/expressionengine/third_party/stash/models/stash_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,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 = $this->EE->config->item('stash_static_character_blacklist')
? (array) $this->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 830f192

Please sign in to comment.