I have made some improvements to the D7 version:

1. Made some coding style improvements to match the Drupal guidelines.
2. The filemtime() call caused a PHP warning if the CSS file didn't exist - Fixed by checking the file doesn't exist first before checking modification times
3. is_writable() returns false if the CSS file doesn't exist - Fixed by checking the directory if the file doesn't exist instead
4. Cleaned up the file_perms() function - It gave me '55' for the permissions which isn't quite right
5. Changed the message arguments to use @var instead of !var as there shouldn't be HTML in those variables and so they should be check_plain()'d.

I've attached the patch to this issue for you to check / merge / comment on.

CommentFileSizeAuthor
some_improvements.patch3.56 KBmjpa

Comments

azarzag’s picture

Thanks for that, I'll make sure We all review it.

mjpa’s picture

Status: Needs review » Fixed

Seems the patch has been committed - thanks :)

alex.pilon’s picture

Thanks for your contribution!

alex.pilon’s picture

Status: Fixed » Closed (fixed)

closing..