Skip to content

Commit

Permalink
Merge pull request #12714 from jdalsem/simplecache-url-args
Browse files Browse the repository at this point in the history
fix(js): validate arguments in elgg.get_simplecache_url
  • Loading branch information
jdalsem committed Jul 11, 2019
2 parents bc44c82 + 91f7c14 commit bcddc0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions views/default/core/js/configuration.js
Expand Up @@ -17,6 +17,8 @@ elgg.get_site_url = function() {
* @return {String} The site URL.
*/
elgg.get_simplecache_url = function(view, subview) {
elgg.assertTypeOf('string', view);

var lastcache, path;

if (elgg.config.simplecache_enabled) {
Expand All @@ -28,6 +30,8 @@ elgg.get_simplecache_url = function(view, subview) {
if (!subview) {
path = '/cache/' + lastcache + '/' + elgg.config.viewtype + '/' + view;
} else {
elgg.assertTypeOf('string', subview);

if ((view === 'js' || view === 'css') && 0 === subview.indexOf(view + '/')) {
subview = subview.substr(view.length + 1);
}
Expand Down

0 comments on commit bcddc0c

Please sign in to comment.