Bug #19361 [Fbk->Csd]: CSS tokenzier generates errors when PHP embedded in CSS file

From: Date: Fri, 11 May 2012 05:42:02 +0000
Subject: Bug #19361 [Fbk->Csd]: CSS tokenzier generates errors when PHP embedded in CSS file
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-8646@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19361&edit=1 ID: 19361 Updated by: gsherwood@squiz.net Reported By: news_001 at washammwa dot de Summary: CSS tokenzier generates errors when PHP embedded in CSS file -Status: Feedback +Status: Closed Type: Bug Package: PHP_CodeSniffer Operating System: debian squeez Package Version: 1.3.3 PHP Version: 5.3.3 Assigned To: squiz Roadmap Versions: New Comment: -Status: Feedback +Status: Closed Assuming it works. Please reopen if incorrect. Previous Comments: ------------------------------------------------------------------------ [2012-04-11 05:26:20] squiz I've committed a fix for CSS tokenizing with embedded PHP tags. Git commit is here: https://github.com/squizlabs/PHP_CodeSniffer/commit/3d66c81cc1768258099bf5d29 4d96cd1376623cd Are you able to clone the git repo and try that version to see if it works for you? ------------------------------------------------------------------------ [2012-04-11 05:18:52] squiz -Summary: Undefined index: bracket_closer in .../Tokenizers/CSS.php +Summary: CSS tokenzier generates errors when PHP embedded in CSS file ------------------------------------------------------------------------ [2012-04-11 03:03:15] squiz I think I see the problem. When PHP tokenizes this string, it see the closing tag and then stops tokenizing the rest. It wont handle PHP embedded into a CSS or JS file, where it doesn't expect there to be any PHP tags. Even though I can't get the tokenizer errors, they look the same as the sniff errors, so I think fixing this will fix your main issue. ------------------------------------------------------------------------ [2012-04-11 02:56:39] squiz I cant get any tokenizer errors to be reported, but I get a errors from the sniffs, which I will look at. I don't know if they will fix the issue you have reported or not. Does the formatting of the CSS file look correct in your comment? Can you paste that single line onto line 2 of a blank CSS file and have PHPCS generate errors or is there more in the file? ------------------------------------------------------------------------ [2012-04-04 10:00:41] christianweiss li {} should be in second line. first line is empty ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://pear.php.net/bugs/bug.php?id=19361 -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19361&edit=1

« previous php.pear.bugs (#8646) next »