PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/Core/wordpress/file.php +15 -3 11.0.1 → 11.1.0 View file →
@@ -129,9 +129,9 @@
129 129 && $wp_filesystem->is_writable($baseDir)
130 130 && $wp_filesystem->move($src, $dest, true)
131 131 ) {
132 132 // Short circuit to prevent file permission errors
133 - if ($wp_filesystem->chmod($dest, FS_CHMOD_FILE)) {
133 + if (acym_chmod($dest, FS_CHMOD_FILE)) {
134 134 return true;
135 135 } else {
136 136 acym_enqueueMessage(acym_translation('ACYM_FILE_REJECTED_SAFETY_REASON'), 'error');
137 137 }
@@ -188,9 +188,19 @@
188 188 require_once ABSPATH.'wp-admin/includes/file.php';
189 189 WP_Filesystem();
190 190 }
191 191
192 - return $wp_filesystem->chmod($path, $mode);
192 + $applied = $wp_filesystem instanceof \WP_Filesystem_Base && $wp_filesystem->chmod($path, $mode);
193 +
194 + clearstatcache(true, $path);
195 + $currentMode = @fileperms($path);
196 +
197 + if ($applied && $currentMode !== false && ($currentMode & 0777) === $mode) {
198 + return true;
199 + }
200 +
201 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_chmod -- Fallback
202 + return @chmod($path, $mode);
193 203 }
194 204
195 205 function acym_deleteFile(string $file): bool
196 206 {
@@ -197,9 +207,11 @@
197 207 if (!file_exists($file)) {
198 208 return true;
199 209 }
200 210
201 - return wp_delete_file($file);
211 + $deleted = wp_delete_file($file);
212 +
213 + return ($deleted || is_null($deleted));
202 214 }
203 215
204 216
205 217 function acym_getInternalFileContents(string $path)