You are here: Foswiki>Tasks Web>Item13554 (03 Feb 2016, GeorgeClark)Edit Attach

Item13554: Foswiki doesn't work with accented Template names

pencil
Priority: Normal
Current State: Closed
Released In: 2.1.0
Target Release: minor
Applies To: Engine
Component: FoswikiTemplates, I18N
Branches: master Item13525 Item13405
Reported By: JozefMojzis
Waiting For:
Last Change By: GeorgeClark

How to repo

-- JozefMojzis - 23 Jul 2015

Just checking ... you are testing the non-default AutoTemplatePlugin, and not the default AutoViewTemplatePlugin.

-- GeorgeClark - 23 Jul 2015

The issue might be in the core Template code. Debug from AutoViewTemplatePlugin:

| 2015-07-23T19:59:23-04:00 debug | - AutoViewTemplatePlugin: formfields detected (TéstForm) |
| 2015-07-23T19:59:23-04:00 debug | - AutoViewTemplatePlugin: called _getTemplateFromTemplateExistence(TéstForm, TestautoForm, Litterbox) |
| 2015-07-23T19:59:23-04:00 debug | - AutoViewTemplatePlugin: VIEW_TEMPLATE set to: Litterbox.TéstView |

And even if I manually set the view template, it still isn't picked up.

-- GeorgeClark - 24 Jul 2015

Working as designed:
    # SMELL: not i18n-friendly (can't have accented characters in template name)
    # zap anything suspicious
    $name =~ s/[^A-Za-z0-9_,.\/]//g;

-- GeorgeClark - 24 Jul 2015

The fix is straight forward, but needs a security review. Original filtering was added in http://develop.twiki.org/~twiki/cgi-bin/view/Bugs/Item5324

-- GeorgeClark - 24 Jul 2015

Ah yes - mea culpa - mean the default AutoViewTemplatePlugin.

-- JozefMojzis - 24 Jul 2015

Unit tests all pass with this patch applied.

-- GeorgeClark - 24 Jul 2015

Due to the risk of allowing utf-8 template names, this will be documented as a known limitation for now. Fix with unit test is attached.

-- GeorgeClark - 24 Jul 2015
 
Topic revision: r15 - 03 Feb 2016, GeorgeClark - This page was cached on 30 Aug 2016 - 06:51.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License