File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 */
1313class Checksum_Plugin_Command extends Checksum_Base_Command {
1414
15- /**
16- * Maximum file size (in bytes) to read when detecting plugin version.
17- * Set to 1MB to prevent memory exhaustion attacks.
18- */
19- const MAX_FILE_SIZE_FOR_VERSION_DETECTION = 1048576 ;
20-
2115 /**
2216 * Cached plugin data for all installed plugins.
2317 *
@@ -262,9 +256,7 @@ private function detect_version_from_directory( $plugin_dir ) {
262256 $ files = glob ( $ plugin_path . '/*.php ' );
263257 if ( is_array ( $ files ) && ! empty ( $ files ) ) {
264258 foreach ( $ files as $ file ) {
265- // Check file size to prevent memory exhaustion
266- $ file_size = filesize ( $ file );
267- if ( false !== $ file_size && $ file_size < self ::MAX_FILE_SIZE_FOR_VERSION_DETECTION && is_readable ( $ file ) ) {
259+ if ( is_readable ( $ file ) ) {
268260 $ file_data = get_file_data (
269261 $ file ,
270262 array ( 'Version ' => 'Version ' )
You can’t perform that action at this time.
0 commit comments