[Plugin: User Avatar] PHP warnings in 1.4.1
-
I just upgraded to User Avatars version 1.4.1 and noticed this error message:
Warning: opendir(/home/snowshoe/public_html/wp-content/uploads/avatars/1/) [function.opendir]: failed to open dir: No such file or directory in /home/snowshoe/public_html/wp-content/plugins/user-avatar/user-avatar.php on line 698
Warning: closedir() expects parameter 1 to be resource, boolean given in /home/snowshoe/public_html/wp-content/plugins/user-avatar/user-avatar.php on line 722
I was able to fix this warning by modifying the code slightly to include is_dir() calls before the opendir() calls. I also moved the closedir() bits into the
if ( $av_dir = opendir( $avatar_folder_dir ) ) {
blocks so that it wouldn’t try to close a dir that wasn’t opened.Here is the diff:
[Diff moderated as per the Forum Rules. Please use the pastebin]
If that looks like a good change to you, please update the repository version of the plugin.
Thanks!
- The topic ‘[Plugin: User Avatar] PHP warnings in 1.4.1’ is closed to new replies.