Skip to content

Undefined offset Tokenizers/CSS.php #1304

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

Closed
grappler opened this issue Jan 24, 2017 · 3 comments
Closed

Undefined offset Tokenizers/CSS.php #1304

grappler opened this issue Jan 24, 2017 · 3 comments

Comments

@grappler
Copy link

When running PHPCS(master) I got a PHP notice while processing certain CSS files. I did not write the code and do not have access to change it.

The error is: Processing style.css PHP Notice: Undefined offset: 93 in Tokenizers/CSS.php on line 452

An example file is https://themes.trac.wordpress.org/browser/bizznis/1.4.0/style.css

@gsherwood
Copy link
Member

gsherwood commented Jan 24, 2017

Again, this is caused by a syntax error in the file. Line 89 has a close comment token but a comment was never opened. This causes all those dashes before the fake comment closer to throw errors in the tokenizer.

You might want to consider reporting these syntax errors to the theme authors instead of me, if you aren't already.

I see if I can hide this error like I did for the JS ones.

@gsherwood
Copy link
Member

I've muted those errors, but there are obviously some pretty bad token results from a large string of uncommented dashes.

@grappler
Copy link
Author

Thanks @gsherwood for fixing these the notices. As there are a number of themes with issues, it will take some time. We are planning of using PHPCS to help improve automated code reveiws for themes being uplaoded to WordPress.org/themes.

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

2 participants