Making WordPress.org


Ignore:
Timestamp:
04/21/2016 07:41:53 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Housekeeping.

  • Updates and corrects doc blocks.
  • Simplifies overqualified class references.
  • Corrects function args and return types.
  • Adds missing labels to input elements.
  • Makes sure variables are set before using them.

See #1584.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tools/class-filesystem.php

    r2640 r2994  
    4040     * Extract a ZIP file to a directory.
    4141     *
    42      * @param string $zip_file The ZIP file to extract.
    43      * @param string $temp_directory The Directory to extract the ZIP to. Optional. Default: A Temporary directory.
     42     * @param string $zip_file  The ZIP file to extract.
     43     * @param string $directory The Directory to extract the ZIP to. Optional. Default: A Temporary directory.
    4444     *
    4545     * @return string The directory the ZIP was extracted to.
     
    103103     * @param string $dir The directory to remove.
    104104     *
    105      * @return bool Whether the directory was removed..
     105     * @return bool Whether the directory was removed.
    106106     */
    107107    public static function rmdir( $dir ) {
    108         if ( ! trim( $dir, '/' ) ) {
    109             return;
     108        if ( trim( $dir, '/' ) ) {
     109            exec( 'rm -rf ' . escapeshellarg( $dir ) );
    110110        }
    111         exec( 'rm -rf ' . escapeshellarg( $dir ) );
    112111
    113112        return is_dir( $dir );
    114113    }
    115 
    116114}
Note: See TracChangeset for help on using the changeset viewer.