1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

allowed route characters?

Discussion in 'XenForo Development Discussions' started by Jake Bunce, Mar 9, 2012.

  1. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    My route changer addon allows you to change routes to anything, but I have found that accented and multi-byte characters simply don't work. I am trying to discover exactly what characters are allowed in routes but I can't find the relevant code that processes routes.
     
  2. ragtek

    ragtek Guest

    This should be required code:
    PHP:
        /**
         * Verifies that the prefix is valid
         *
         * @param string $prefix
         * @param XenForo_DataWriter $dw Ignored
         * @param string $fieldName Name of the field that triggered this function
         *
         * @return boolean
         */
        
    protected function _verifyPrefix(&$prefix$dw$fieldName)
        {
            if (
    preg_match('#[\?&=/\. \#\[\]%:;]#'$prefix))
            {
                
    $this->error(new XenForo_Phrase('please_enter_valid_prefix'), $fieldName);
                return 
    false;
            }

            return 
    true;
        }
    it's inside the route prefix datawriter
     
    Jake Bunce likes this.

Share This Page