divio/django-cms — Issue #1068: Placeholders name with spaces break the cache 
Author: elpargo
Created: 2011-10-24 17:19:39+00:00
State: open

In one of our apps we have placeholder names with spaces, as far as I am concern this is a valid use case.

The placeholder template tag is smart enough to understand this case, however it is missing to escape one part of the name.

In the following line

https://github.com/divio/django-cms/blob/develop/cms/templatetags/cms_tags.py#L334

If the variable "placeholder_name" contains spaces it is not escaped. A simple change to

cache_key = _get_cache_key('_show_placeholder_for_page', page_lookup, lang, site_id)+'_placeholder:'+_clean_key(placeholder_name)

fixed it although a better solution could be found.

The root problem here is that it's creating keys that are not compatible with memcache as it demands no spaces in the key name.