Skip to content

Commit

Permalink
v4.4.8.2 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
kprovance committed Oct 23, 2023
1 parent a3eeb8a commit bbafe02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions redux-core/inc/classes/class-redux-filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public function put_contents( string $abs_path, string $contents, string $perms

// phpcs:ignore WordPress.PHP.NoSilencedErrors
// @codingStandardsIgnoreStart
$return = @file_put_contents( $abs_path, $contents );
$return = is_writable( $abs_path ) ? @file_put_contents( $abs_path, $contents ) : false;
// @codingStandardsIgnoreEnd
$this->chmod( $abs_path );

Expand All @@ -542,7 +542,8 @@ public function put_contents( string $abs_path, string $contents, string $perms

if ( ! $return && $this->use_filesystem ) {
$abs_path = $this->get_sanitized_path( $abs_path );
$return = $this->wp_filesystem->put_contents( $abs_path, $contents, $perms );
// phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_is_writable
$return = is_writable( $abs_path ) && $this->wp_filesystem->put_contents( $abs_path, $contents, $perms );
}

return (bool) $return;
Expand Down

0 comments on commit bbafe02

Please sign in to comment.