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

allowed route characters?

Jake Bunce

XenForo moderator
Staff member
#1
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.
 
R

ragtek

Guest
#2
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