check return type on log file fopen
This commit is contained in:
parent
d7eb6d0b9e
commit
c51f748855
|
@ -146,10 +146,12 @@ class WC_Log_Handler_File extends WC_Log_Handler {
|
|||
if ( $file ) {
|
||||
if ( ! file_exists( $file ) ) {
|
||||
$temphandle = @fopen( $file, 'w+' ); // @codingStandardsIgnoreLine.
|
||||
@fclose( $temphandle ); // @codingStandardsIgnoreLine.
|
||||
|
||||
if ( Constants::is_defined( 'FS_CHMOD_FILE' ) ) {
|
||||
@chmod( $file, FS_CHMOD_FILE ); // @codingStandardsIgnoreLine.
|
||||
if ( is_resource( $temphandle ) ) {
|
||||
@fclose( $temphandle ); // @codingStandardsIgnoreLine.
|
||||
|
||||
if ( Constants::is_defined( 'FS_CHMOD_FILE' ) ) {
|
||||
@chmod( $file, FS_CHMOD_FILE ); // @codingStandardsIgnoreLine.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue