Plugin Directory

Changeset 2475134


Ignore:
Timestamp:
02/15/2021 08:49:49 PM (5 years ago)
Author:
minnur
Message:

Secueirt improvements.

Location:
external-media/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • external-media/trunk/external-media.php

    r2406122 r2475134  
    88  Plugin Name: External Media
    99  Description: Import files from thrid-party services (Dropbox, Box, OneDrive, Google Drive and any remote URL).
    10   Version: 1.0.27
     10  Version: 1.0.28
    1111  Author: Minnur Yunusov
    1212  Author URI: http://www.minnur.com/
     
    1818define( 'WP_ExternalMedia_PluginName', plugin_basename( __FILE__ ) );
    1919define( 'WP_ExternalMedia_Prefix', 'WPExternalMedia_' );
    20 define( 'WP_ExternalMedia_Version', '1.0.27' );
     20define( 'WP_ExternalMedia_Version', '1.0.28' );
    2121
    2222if ( !class_exists( 'WP_ExternalMedia' ) ) {
  • external-media/trunk/includes/WP_ExternalPluginBase.php

    r2335386 r2475134  
    200200
    201201    if ( !function_exists( 'curl_init' ) || empty( $filename ) ) {
     202      return;
     203    }
     204
     205    $extensions = apply_filters( 'external_media_safe_extensions', 'jpg jpeg gif png mp3 mp4 m4v mov webm' );
     206    if ($this->isUnsafe( $filename, $extensions )) {
    202207      return;
    203208    }
     
    279284  }
    280285
     286  /**
     287   * Check if file extension is unsafe to upload.
     288   */
     289  protected function isUnsafe( $filename, $extensions ) {
     290    if (preg_match('/\.(php|phar|pl|py|cgi|asp|js|html|htm|xml)(\.|$)/i', $filename)) {
     291      $regex = '/\.(' . preg_replace('/ +/', '|', preg_quote($extensions)) . ')$/i';
     292      if (!preg_match($regex, $filename)) {
     293        return true;
     294      }
     295    }
     296  }
     297
    281298}
  • external-media/trunk/readme.txt

    r2406122 r2475134  
    77Requires at least: 5.4
    88Tested up to: 5.5.1
    9 Stable tag: 1.0.27
     9Stable tag: 1.0.28
    1010Requires PHP: 7.1
    1111License: GPLv2 or later
     
    131131== Changelog ==
    132132
     133= 1.0.28 =
     134* Improve security.
     135* Version bump.
    133136= 1.0.27 =
    134137* Update plugin information.
Note: See TracChangeset for help on using the changeset viewer.