Changeset 3431708
- Timestamp:
- 01/03/2026 03:19:46 PM (7 weeks ago)
- Location:
- easy-dropbox-integration
- Files:
-
- 2 added
- 12 edited
- 1 copied
-
tags/1.12.6 (copied) (copied from easy-dropbox-integration/trunk)
-
tags/1.12.6/app/Thumbnail.php (modified) (2 diffs)
-
tags/1.12.6/easy-dropbox-integration.php (modified) (2 diffs)
-
tags/1.12.6/includes/Activate.php (modified) (1 diff)
-
tags/1.12.6/includes/Helper.php (modified) (1 diff)
-
tags/1.12.6/includes/Updates.php (modified) (1 diff)
-
tags/1.12.6/readme.txt (modified) (2 diffs)
-
tags/1.12.6/updates/class-update-1.12.6.php (added)
-
trunk/app/Thumbnail.php (modified) (2 diffs)
-
trunk/easy-dropbox-integration.php (modified) (2 diffs)
-
trunk/includes/Activate.php (modified) (1 diff)
-
trunk/includes/Helper.php (modified) (1 diff)
-
trunk/includes/Updates.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/updates/class-update-1.12.6.php (added)
Legend:
- Unmodified
- Added
- Removed
-
easy-dropbox-integration/tags/1.12.6/app/Thumbnail.php
r3424111 r3431708 87 87 $this->thumbnails_location_url = EDBI_CACHE_DIR_URL . 'thumbnails/' . $account_id . '/'; 88 88 89 // Secure thumbnail location if no security. 90 Helper::secure_directory_with_index( $this->thumbnails_location ); 91 92 // Add .htaccess protection to the thumbnail directory. 93 Helper::secure_cache_directory( $this->thumbnails_location ); 94 89 95 $this->size = $size; 90 96 … … 141 147 $thumbnail = $thumbnail->getContents(); 142 148 143 if ( ! file_exists( $this->thumbnails_location ) ) { 144 wp_mkdir_p( $this->thumbnails_location ); 145 } 149 // Secure the account-specific thumbnail directory with index.php. 150 Helper::secure_directory_with_index( $this->thumbnails_location ); 146 151 147 // put a index.php inside location if not exists. 148 if ( ! file_exists( $this->thumbnails_location . 'index.php' ) ) { 149 $wp_filesystem->put_contents( $this->thumbnails_location . 'index.php', '<?php exit; ?>', FS_CHMOD_FILE ); 150 } 151 152 // file_put_contents( $file, $thumbnail ); 152 // Save the thumbnail file. 153 153 if ( ! $wp_filesystem->put_contents( $file, $thumbnail, FS_CHMOD_FILE ) ) { 154 154 return false; -
easy-dropbox-integration/tags/1.12.6/easy-dropbox-integration.php
r3431689 r3431708 23 23 * Plugin URI: https://ultradevs.com/easy-dropbox-integration/ 24 24 * Description: Easy DropBox Integration - Browse, Upload, Manage Your Dropbox Files from Your Website Easily. 25 * Version: 1.12. 525 * Version: 1.12.6 26 26 * Author: ultraDevs 27 27 * Author URI: https://ultradevs.com … … 35 35 36 36 // Constant. 37 define( 'EDBI_VERSION', '1.12. 5' );37 define( 'EDBI_VERSION', '1.12.6' ); 38 38 define( 'EDBI_NAME', 'Easy Dropbox Integration' ); 39 39 define( 'EDBI_DIR_PATH', plugin_dir_path( __FILE__ ) ); -
easy-dropbox-integration/tags/1.12.6/includes/Activate.php
r3431687 r3431708 95 95 96 96 foreach ( $directories as $directory ) { 97 if ( ! file_exists( $directory ) ) {98 wp_mkdir_p( $directory );99 }97 // Secure directory with index.php file. 98 Helper::secure_directory_with_index( $directory ); 99 } 100 100 101 // Create an index.php file in the directory using WP_Filesystem. 102 global $wp_filesystem; 103 104 if ( empty( $wp_filesystem ) ) { 105 require_once ABSPATH . '/wp-admin/includes/file.php'; 106 WP_Filesystem(); 107 } 108 109 $index_content = "<?php\n// Silence is golden\n"; 110 $wp_filesystem->put_contents( 111 $directory . 'index.php', 112 $index_content, 113 FS_CHMOD_FILE 114 ); 115 } 101 // Add .htaccess protection to the main cache directory. 102 Helper::secure_cache_directory( EDBI_CACHE_DIR ); 116 103 } 117 104 -
easy-dropbox-integration/tags/1.12.6/includes/Helper.php
r3424111 r3431708 1557 1557 1558 1558 /** 1559 * Secure Directory with Index File 1560 * 1561 * Creates an index.php file in a directory to prevent directory browsing. 1562 * 1563 * @param string $directory The directory path to secure. 1564 * @return bool True if successful, false otherwise. 1565 */ 1566 public static function secure_directory_with_index( $directory ) { 1567 // Initialize WP_Filesystem if not already initialized. 1568 global $wp_filesystem; 1569 1570 if ( empty( $wp_filesystem ) ) { 1571 require_once ABSPATH . '/wp-admin/includes/file.php'; 1572 WP_Filesystem(); 1573 } 1574 1575 // Ensure directory exists. 1576 if ( ! wp_mkdir_p( $directory ) ) { 1577 return false; 1578 } 1579 1580 $index_file = trailingslashit( $directory ) . 'index.php'; 1581 1582 // Only create if it doesn't exist. 1583 if ( ! $wp_filesystem->exists( $index_file ) ) { 1584 $index_content = "<?php\n// Silence is golden.\n"; 1585 return $wp_filesystem->put_contents( $index_file, $index_content, FS_CHMOD_FILE ); 1586 } 1587 1588 return true; 1589 } 1590 1591 /** 1592 * Secure Cache Directory with .htaccess 1593 * 1594 * Creates a .htaccess file in the cache directory to deny direct access. 1595 * 1596 * @param string $cache_dir The cache directory path. 1597 * @return bool True if successful, false otherwise. 1598 */ 1599 public static function secure_cache_directory( $cache_dir ) { 1600 // Initialize WP_Filesystem if not already initialized. 1601 global $wp_filesystem; 1602 1603 if ( empty( $wp_filesystem ) ) { 1604 require_once ABSPATH . '/wp-admin/includes/file.php'; 1605 WP_Filesystem(); 1606 } 1607 1608 // Ensure directory exists. 1609 if ( ! wp_mkdir_p( $cache_dir ) ) { 1610 return false; 1611 } 1612 1613 $htaccess_file = trailingslashit( $cache_dir ) . '.htaccess'; 1614 1615 // Only create if it doesn't exist. 1616 if ( ! $wp_filesystem->exists( $htaccess_file ) ) { 1617 $htaccess_content = "Deny from all\n"; 1618 return $wp_filesystem->put_contents( $htaccess_file, $htaccess_content, FS_CHMOD_FILE ); 1619 } 1620 1621 return true; 1622 } 1623 1624 /** 1559 1625 * Check Users Role 1560 1626 * -
easy-dropbox-integration/tags/1.12.6/includes/Updates.php
r3424111 r3431708 34 34 '1.7.0', 35 35 '1.12.0', 36 '1.12.6', 36 37 ]; 37 38 -
easy-dropbox-integration/tags/1.12.6/readme.txt
r3431689 r3431708 5 5 Requires at least: 5.3.2 6 6 Tested up to: 6.9 7 Stable tag: 1.12. 57 Stable tag: 1.12.6 8 8 Requires PHP: 7.4.0 9 9 License: GPLv2 or later … … 147 147 148 148 == Changelog == 149 150 = 1.12.6 - 3 January, 2026 = 151 - **Improvement:** Thumbnail folder security. 149 152 150 153 = 1.12.5 - 3 January, 2026 = -
easy-dropbox-integration/trunk/app/Thumbnail.php
r3424111 r3431708 87 87 $this->thumbnails_location_url = EDBI_CACHE_DIR_URL . 'thumbnails/' . $account_id . '/'; 88 88 89 // Secure thumbnail location if no security. 90 Helper::secure_directory_with_index( $this->thumbnails_location ); 91 92 // Add .htaccess protection to the thumbnail directory. 93 Helper::secure_cache_directory( $this->thumbnails_location ); 94 89 95 $this->size = $size; 90 96 … … 141 147 $thumbnail = $thumbnail->getContents(); 142 148 143 if ( ! file_exists( $this->thumbnails_location ) ) { 144 wp_mkdir_p( $this->thumbnails_location ); 145 } 149 // Secure the account-specific thumbnail directory with index.php. 150 Helper::secure_directory_with_index( $this->thumbnails_location ); 146 151 147 // put a index.php inside location if not exists. 148 if ( ! file_exists( $this->thumbnails_location . 'index.php' ) ) { 149 $wp_filesystem->put_contents( $this->thumbnails_location . 'index.php', '<?php exit; ?>', FS_CHMOD_FILE ); 150 } 151 152 // file_put_contents( $file, $thumbnail ); 152 // Save the thumbnail file. 153 153 if ( ! $wp_filesystem->put_contents( $file, $thumbnail, FS_CHMOD_FILE ) ) { 154 154 return false; -
easy-dropbox-integration/trunk/easy-dropbox-integration.php
r3431689 r3431708 23 23 * Plugin URI: https://ultradevs.com/easy-dropbox-integration/ 24 24 * Description: Easy DropBox Integration - Browse, Upload, Manage Your Dropbox Files from Your Website Easily. 25 * Version: 1.12. 525 * Version: 1.12.6 26 26 * Author: ultraDevs 27 27 * Author URI: https://ultradevs.com … … 35 35 36 36 // Constant. 37 define( 'EDBI_VERSION', '1.12. 5' );37 define( 'EDBI_VERSION', '1.12.6' ); 38 38 define( 'EDBI_NAME', 'Easy Dropbox Integration' ); 39 39 define( 'EDBI_DIR_PATH', plugin_dir_path( __FILE__ ) ); -
easy-dropbox-integration/trunk/includes/Activate.php
r3431687 r3431708 95 95 96 96 foreach ( $directories as $directory ) { 97 if ( ! file_exists( $directory ) ) {98 wp_mkdir_p( $directory );99 }97 // Secure directory with index.php file. 98 Helper::secure_directory_with_index( $directory ); 99 } 100 100 101 // Create an index.php file in the directory using WP_Filesystem. 102 global $wp_filesystem; 103 104 if ( empty( $wp_filesystem ) ) { 105 require_once ABSPATH . '/wp-admin/includes/file.php'; 106 WP_Filesystem(); 107 } 108 109 $index_content = "<?php\n// Silence is golden\n"; 110 $wp_filesystem->put_contents( 111 $directory . 'index.php', 112 $index_content, 113 FS_CHMOD_FILE 114 ); 115 } 101 // Add .htaccess protection to the main cache directory. 102 Helper::secure_cache_directory( EDBI_CACHE_DIR ); 116 103 } 117 104 -
easy-dropbox-integration/trunk/includes/Helper.php
r3424111 r3431708 1557 1557 1558 1558 /** 1559 * Secure Directory with Index File 1560 * 1561 * Creates an index.php file in a directory to prevent directory browsing. 1562 * 1563 * @param string $directory The directory path to secure. 1564 * @return bool True if successful, false otherwise. 1565 */ 1566 public static function secure_directory_with_index( $directory ) { 1567 // Initialize WP_Filesystem if not already initialized. 1568 global $wp_filesystem; 1569 1570 if ( empty( $wp_filesystem ) ) { 1571 require_once ABSPATH . '/wp-admin/includes/file.php'; 1572 WP_Filesystem(); 1573 } 1574 1575 // Ensure directory exists. 1576 if ( ! wp_mkdir_p( $directory ) ) { 1577 return false; 1578 } 1579 1580 $index_file = trailingslashit( $directory ) . 'index.php'; 1581 1582 // Only create if it doesn't exist. 1583 if ( ! $wp_filesystem->exists( $index_file ) ) { 1584 $index_content = "<?php\n// Silence is golden.\n"; 1585 return $wp_filesystem->put_contents( $index_file, $index_content, FS_CHMOD_FILE ); 1586 } 1587 1588 return true; 1589 } 1590 1591 /** 1592 * Secure Cache Directory with .htaccess 1593 * 1594 * Creates a .htaccess file in the cache directory to deny direct access. 1595 * 1596 * @param string $cache_dir The cache directory path. 1597 * @return bool True if successful, false otherwise. 1598 */ 1599 public static function secure_cache_directory( $cache_dir ) { 1600 // Initialize WP_Filesystem if not already initialized. 1601 global $wp_filesystem; 1602 1603 if ( empty( $wp_filesystem ) ) { 1604 require_once ABSPATH . '/wp-admin/includes/file.php'; 1605 WP_Filesystem(); 1606 } 1607 1608 // Ensure directory exists. 1609 if ( ! wp_mkdir_p( $cache_dir ) ) { 1610 return false; 1611 } 1612 1613 $htaccess_file = trailingslashit( $cache_dir ) . '.htaccess'; 1614 1615 // Only create if it doesn't exist. 1616 if ( ! $wp_filesystem->exists( $htaccess_file ) ) { 1617 $htaccess_content = "Deny from all\n"; 1618 return $wp_filesystem->put_contents( $htaccess_file, $htaccess_content, FS_CHMOD_FILE ); 1619 } 1620 1621 return true; 1622 } 1623 1624 /** 1559 1625 * Check Users Role 1560 1626 * -
easy-dropbox-integration/trunk/includes/Updates.php
r3424111 r3431708 34 34 '1.7.0', 35 35 '1.12.0', 36 '1.12.6', 36 37 ]; 37 38 -
easy-dropbox-integration/trunk/readme.txt
r3431689 r3431708 5 5 Requires at least: 5.3.2 6 6 Tested up to: 6.9 7 Stable tag: 1.12. 57 Stable tag: 1.12.6 8 8 Requires PHP: 7.4.0 9 9 License: GPLv2 or later … … 147 147 148 148 == Changelog == 149 150 = 1.12.6 - 3 January, 2026 = 151 - **Improvement:** Thumbnail folder security. 149 152 150 153 = 1.12.5 - 3 January, 2026 =
Note: See TracChangeset
for help on using the changeset viewer.