Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect UTF characters in: date.js and date.min.js #1065

Closed
CaptainTomBln opened this issue May 25, 2023 · 5 comments
Closed

Incorrect UTF characters in: date.js and date.min.js #1065

CaptainTomBln opened this issue May 25, 2023 · 5 comments

Comments

@CaptainTomBln
Copy link

Environment

For bug reports, please run the following code in your environment and include the output:

console.log({
  moment: moment.version,
  momentTz: moment.tz.version,
  date: (new Date()).toString(),
  intlZone: new Intl.DateTimeFormat().resolvedOptions().timeZone,
});

Issue description

Hi there,

I am running three WP websites and I have to deal with many hacker attacks, So I installed the Anti-Malware plugin that works properly. But there are two files that cannot be scanned: date.js and date.min.js. Also my editor doesn't load them, complaining that there are some wrong UTF characters included into the file. This is the same with all three websites. Using MS Word and saving the files again with the option "allow changing characters" I could make them readably by my editor as well as by the anti-malware scanner. But I am not sure if I didn't change anything important in those huge resources.

So I would like to propose that you find the problem in your source files and provide them with WP in a correct format. My editor is PSPad, if this helps you to identify the problem.

Thanks, Thomas

@gilmoreorless
Copy link
Member

Hi, this project is not associated with Wordpress, and doesn't produce any files called date.js or date.min.js.
My guess is that there is a separate project/plugin that includes this library, and that's what's adding the invalid characters.

To double-check this, try loading just a file produced by this project and see if the problem remains. Here are some examples:

@CaptainTomBln
Copy link
Author

Dear Gilmore, thank you very much for your reply. In both files I found the following:
//! version : 0.5.40
//! Copyright (c) JS Foundation and other contributors
//! license : MIT
//! github.com/moment/moment-timezone
The fourth line is pointing to this page.
The path of the two files is /wp-includes/js/dist/.
I'm wondering if any plugin may write into /wp-includes/?
In the code I also find an error message referring to https://momentjs.com/timezone/docs/. There I find a link to this Github Page.
Since the files refer to momentjs I will try to find some contact there.
Thanks, Thomas

@gilmoreorless
Copy link
Member

I downloaded a fresh copy of Wordpress to take a look. Yes, the date.js file includes both the moment and moment-timezone libraries, which are both part of the Moment group of projects (so raising a separate ticket for momentjs.com doesn't add anything). But the process that includes them in Wordpress is handled entirely by Wordpress, not this group.

Did you try opening either of the links I posted in my first reply?

I also suggest you download a fresh copy of Wordpress from https://wordpress.org/download/ and open the same date.js file in your editor. If that doesn't have a problem, then something else is corrupting your project, and it isn't caused by the source code in these libraries.

As for whether something else is writing to wp-includes, I have to repeat: This project is not associated with Wordpress in any way. We can't and won't provide support for unrelated software.

@CaptainTomBln
Copy link
Author

Dear Gilmore,
thank you very much for your explanation and your hint to download that latest version of WP (sorry for not seeing this way in my confusion). Your expectation was right: The files in WP are okay. Something else must have corrupted my files.
Thomas

@sslincoco
Copy link

sslincoco commented Sep 9, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants