Changeset 52698
- Timestamp:
- 02/10/2022 03:01:06 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r52640 r52698 6567 6567 */ 6568 6568 function get_file_data( $file, $default_headers, $context = '' ) { 6569 // We don't need to write to the file, so just open for reading. 6570 $fp = fopen( $file, 'r' ); 6571 6572 if ( $fp ) { 6573 // Pull only the first 8 KB of the file in. 6574 $file_data = fread( $fp, 8 * KB_IN_BYTES ); 6575 6576 // PHP will close file handle, but we are good citizens. 6577 fclose( $fp ); 6578 } else { 6569 // Pull only the first 8 KB of the file in. 6570 $file_data = file_get_contents( $file, false, null, 0, 8 * KB_IN_BYTES ); 6571 6572 if ( false === $file_data ) { 6579 6573 $file_data = ''; 6580 6574 }
Note: See TracChangeset
for help on using the changeset viewer.