joomla/joomla-cms — pull request #5219 by Bakual (2014-11-26 22:20:07+00:00)
Title: Copy Template uses wrong name to replace in the manifest file.

### Issue
The copy template feature in our template manager fails when the template has a name with spaces or special characters defined in the XML.
The reason is that the method uses the name from the database, which is a sanitised version of the XML name. The real name is saved in the manifest_cache.

### Solution
Get and use the name from the manifest_cache instead for the search/replace function.

### Testing
Try to copy a template with a space or special character in the name.
You can use my template `{LESS} Allrounder` (http://www.bakual.net/download/less-allrounder/less-allrounder-2-0-1/tpl_lessallrounder-zip-5.raw) to do that.
Without patch it will tell you that it worked, but when you're going to check, it didn't copy the template (instead it "updated" the existing one).
With patch it will still tell you that it worked, but now when you're going to check there now is a second template with the new name.

Make also sure that other templates like Protostar still work to copy.