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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Non Latin address/URL


Go to End


4 Posts   1444 Views

Avatar
spyrosk

Community Member, 16 Posts

11 February 2011 at 2:52am

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

Forum Moderator, 5523 Posts

12 February 2011 at 3:02pm

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

Community Member, 16 Posts

8 April 2011 at 8:16pm

Edited: 08/04/2011 8:17pm

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

Community Member, 16 Posts

21 April 2011 at 1:35am

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?