mirror of
https://github.com/LamGC/wp-asciiplayer.git
synced 2026-11-27 05:05:50 +00:00
Document bounded temporary-upload stream exceptions
Build and WordPress integration / PHP 7.4 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / PHP 8.3 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / WordPress 6.3 / PHP 7.4 (push) Canceled after 0s
Build and WordPress integration / WordPress latest / PHP 8.2 (push) Canceled after 0s
Build and WordPress integration / PHP 7.4 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / PHP 8.3 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / WordPress 6.3 / PHP 7.4 (push) Canceled after 0s
Build and WordPress integration / WordPress latest / PHP 8.2 (push) Canceled after 0s
This commit is contained in:
@@ -130,7 +130,8 @@ function is_valid_cast_file( $path ) {
|
|||||||
if ( ! is_string( $path ) || '' === $path || false !== strpos( $path, '://' ) || ! is_file( $path ) || ! is_readable( $path ) ) {
|
if ( ! is_string( $path ) || '' === $path || false !== strpos( $path, '://' ) || ! is_file( $path ) || ! is_readable( $path ) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$handle = fopen( $path, 'rb' );
|
// Read-only local upload validation needs bounded streaming; WP_Filesystem reads whole files.
|
||||||
|
$handle = fopen( $path, 'rb' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen -- Local temporary upload only; wrappers rejected above.
|
||||||
if ( false === $handle ) {
|
if ( false === $handle ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -180,7 +181,7 @@ function is_valid_cast_file( $path ) {
|
|||||||
}
|
}
|
||||||
return feof( $handle );
|
return feof( $handle );
|
||||||
} finally {
|
} finally {
|
||||||
fclose( $handle );
|
fclose( $handle ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose -- Always close the bounded read-only upload stream.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user