jquery / themeroller.jquerymobile.com

ThemeRoller site for jQuery Mobile
Other
140 stars 73 forks source link

Fix "PHP Warning: No such file or directory css/user_themes/20141204-94.css in share.php:21" #216

Closed Krinkle closed 7 years ago

Krinkle commented 9 years ago

The Apache2 error logs (splunk.jquery.com) are flooded with these:

[05-Jan-2015 15:22:01 America/Los_Angeles] PHP Warning:  unlink(css/
 user_themes/20141204-94.css):
 No such file or directory in /var/www/themeroller.jquerymobile.com/share.php on line 21
[05-Jan-2015 15:22:01 America/Los_Angeles] PHP Warning:  unlink(css/
 user_themes/20141204-93.css):
 No such file or directory in /var/www/themeroller.jquerymobile.com/share.php on line 21

Either the file is supposed to exist and a bug elsewhere needs fixing, or the code should do a file_exists check first. Depending on what the http request needs, it may also need an else handling in case the file doesn't exist. Alternatively, the warning could be surpressed with @unlink().