Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Non Latin address/URL


Reply

4 Posts   913 Views

Avatar
spyrosk

11 February 2011 at 2:52am Community Member, 16 Posts

Hi, I am facing a problem when I try to change the URL of pages in SS. I have set the locale correctly to Greek, but every time I try to enter a value containing greek characters I get the following error:

Changed value to '' : URLs can only be made up of letters, digits and hyphens.

Although I have searched for a solution I haven't found any. Is there a way around this?
I understand what makes a valid url and which characters should be excluded but is this a bug or a missing feature?

Avatar
Willr

12 February 2011 at 3:02pm Forum Moderator, 5511 Posts

I understand what makes a valid url and which characters should be excluded but is this a bug or a missing feature?

I believe the UniqueRestrictedTextField for the URLSegment validates on alphanumeric and hyphens. There is a class to handle some translations of unicode strings to 'safe' versions (Transliterator.php) but not sure if that is used in the validation.

Avatar
spyrosk

8 April 2011 at 8:16pm (Last edited: 8 April 2011 8:17pm), Community Member, 16 Posts

Hi, I've checked the SiteTree class and I found the UniqueRestrictedTextField regex that matches the allowed characters ("[^A-Za-z0-9-]+").
I suppose that PCRE is used to match this, so would adding \p{Greek} to the expression work,
e.g. "[^A-Za-z\p{Greek}0-9-]+" ?

(Sorry but I'm not really familiar with regex's so I'm not sure if this is correct)

Avatar
spyrosk

21 April 2011 at 1:35am Community Member, 16 Posts

Ok, I've changed the regex in Sitetree.php to the one in the previous post, and at least SS stopped complaining about restricted characters. The problem though remains and page URL's change to page-* after save.
Does anyone know where the change is happening?