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

Fixed unrecognized expression error in xenforo.js

Discussion in 'Resolved Bug Reports' started by Gia Bảo, Apr 29, 2014.

  1. Gia Bảo

    Gia Bảo Member

    Goto this url:
    Uncaught Error: Syntax error, unrecognized expression: #/xyz/0

    This error is throw in xenforo.js:

    $(window).on('load', function() {
        if (isScrolled || !window.location.hash)
        var hash = window.location.hash.replace(/[:.#\s\[\]]/g, ''),
            $match = $('#' + hash); //error here
        if ($match.length)
    I know this error is harmless. But it's better to be fixed.

    Of course this error will be thrown if we add a hash like #/xyz/0 to every forum url (in my custom route prefix too)
  2. Mike

    Mike XenForo Developer Staff Member

    Fixed - I changed from trying to strip invalid characters to whitelisting alphanumeric, underscore and dash.

Share This Page