WordPress.org

Ready to get started?Download WordPress

Forums

Codestyling Localization
[resolved] Fix for warnings about unreadable folders (2 posts)

  1. Alexander Gieg
    Member
    Posted 2 years ago #

    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/

  2. codestyling
    Member
    Plugin Author

    Posted 2 years ago #

    Has been repaired with version 1.99.18, please let me know, if any issues still remaining.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic