WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Codestyling Localization] Fix for warnings about unreadable folders

[Resolved] [Plugin: Codestyling Localization] Fix for warnings about unreadable folders

  • I use SVN to install and update WordPress via the shell, so to avoid having all the “.svn” folders it spreads around reachable through the web I do a

    $ find . -name \*.svn\* -exec chmod 700 {} \;

    to prevent Apache from accessing them. Codestyling Localization 1.99.16, however, doesn’t check whether a folder is readable before trying to read it, what results in four PHP warnings for every “.svn” folder it finds:

    Warning: scandir(/web_root_folder/wordpress/wp-content/plugins/akismet/.svn/) [function.scandir]: failed to open dir: Permission denied in /web_root_folder/wordpress/wp-content/plugins/codestyling-localization/codestyling-localization.php on line 258

    Warning: scandir() [function.scandir]: (errno 13): Permission denied in /web_root_folder/wordpress/wp-content/plugins/codestyling-localization/codestyling-localization.php on line 258

    Warning: array_diff() [function.array-diff]: Argument #1 is not an array in /web_root_folder/wordpress/wp-content/plugins/codestyling-localization/codestyling-localization.php on line 258

    Warning: Invalid argument supplied for foreach() in /web_root_folder/wordpress/wp-content/plugins/codestyling-localization/codestyling-localization.php on line 259

    The fix is easy enough. Open “wordpress/wp-content/plugins/codestyling-localization/codestyling-localization.php”, and change line 258 from:

    if (!is_dir($base)) return $data;

    To:

    if (!is_dir($base) || !is_readable($base)) return $data;

    And presto, no more warnings.

    http://wordpress.org/extend/plugins/codestyling-localization/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Codestyling Localization] Fix for warnings about unreadable folders’ is closed to new replies.