Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#54046 new defect (bug)

Uncaught SyntaxError: Invalid regular expression

Reported by: mmakenzi's profile mmakenzi Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.8
Component: Editor Keywords:
Focuses: javascript Cc:

Description

Hi

I am trying to install a fresh version of WordPress on my server
but the problem is, on the add new post page, I am getting this error:

Uncaught SyntaxError: Invalid regular expression: /[!-/:-@[-`{-~б─-б©ц≈ц╥Б──-Б╞©Б╦─-Б╧©]/: Range out of order in character class
    at new RegExp (<anonymous>)
    at Module.pC98 (wordcount.min.js?ver=61ab1af9326f4d5fda7ed01990e1be70:2)
    at t (wordcount.min.js?ver=61ab1af9326f4d5fda7ed01990e1be70:2)
    at wp.wordcount.YLtl (wordcount.min.js?ver=61ab1af9326f4d5fda7ed01990e1be70:2)
    at wordcount.min.js?ver=61ab1af9326f4d5fda7ed01990e1be70:2

however everything is fine even with this error until I try to install SEO plugins, like Yoast SEO and Rank Math SEO, but the cause of the problem is WordPress

I tried everything to see if this problem will gone away or not
Tested with php 7.4 and 8.0
Tested with chrome, firefox and opera
Tested with mysql and mariadb, also tested with different charset

Change History (3)

#1 @mmakenzi
3 years ago

I tested on different OS (Ubuntu) but nothing changed

Last edited 3 years ago by mmakenzi (previous) (diff)

#2 @SergeyBiryukov
3 years ago

  • Component changed from Posts, Post Types to Editor

#3 @mmakenzi
3 years ago

I found the cause of the problem
I made a mistake and set a charset setting in my Nginx virtual machine config file "charset koi8-r;"
now all edit pages and add a new post or a new page, give me the same error

when I changed the website address from www.mywebsite.com to beta.mywebsite.com, everything is fine, and the error is gone, but when I switch back to the default address, the error appear again

I think because of the wrong charset that was set in Nginx config file, some wrong data was stored for the default address in database, but when I change the address the data was created again

so do you know how can I fix the data?
"

Note: See TracTickets for help on using tickets.