Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » Non Latin address/URL

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

Page: 1
Go to End
Author Topic: 843 Views
  • spyrosk
    Avatar
    Community Member
    16 Posts

    Non Latin address/URL Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Non Latin address/URL Link to this post

    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.

  • spyrosk
    Avatar
    Community Member
    16 Posts

    Re: Non Latin address/URL Link to this post

    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)

  • spyrosk
    Avatar
    Community Member
    16 Posts

    Re: Non Latin address/URL Link to this post

    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?

    843 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.