Closed (cannot reproduce)
Project:
CSSTidy
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2010 at 15:08 UTC
Updated:
23 Aug 2010 at 22:28 UTC
I just installed the module and opened /admin/settings/performance where I am getting the following error message (standard Drupal message area):
warning: Division by zero in /usr/local/www/apache22/data/drupal/sites/all/modules/csstidy/csstidy/class.csstidy_print.php on line 303.
Comments
Comment #1
philbar commentedIs it possible you are trying to run CSSTidy on an empty stylesheet?
The PHP function resulting in the divide by zero error is
strlenrun on the original stylesheet which has not been processed by CSSTidy.Comment #2
jaochoo commentedWell, I don't know.. ;-) I am using a Zen subtheme with a lot of CSS files; furthermore I guess there are many CSS files included by various contrib modules. So I really don't know if there is an empty stylesheet in all the CSS files. Actually, there shouldn't be, but I can't tell you. Anyways, IMHO this module should work even with empty stylesheets, otherwise every user would have to check all his stylesheets.
Comment #3
el7cosmosi've got a lot of this error when i visit admin/build/modules ...
Comment #4
philbar commentedWell, I'm not really sure what could be going on.
The code causing this error is found in
/csstidy/class.csstidy_print.php:Specifically
strlen($this->input_css)in returning 0, which causes the php error.Comment #5
philbar commentedCan you test the following fix?
Replace the code on line 292 of
/csstidy/class.csstidy_print.phpwith this: