@@ 207-219 (lines=13) @@ | ||
204 | if( ! EEH_File::ensure_folder_exists_and_is_writable( $parent_folder ) ) { |
|
205 | return false; |
|
206 | } |
|
207 | if ( ! EEH_File::verify_is_writable( $parent_folder, 'folder' )) { |
|
208 | return false; |
|
209 | } else { |
|
210 | if ( ! $wp_filesystem->mkdir( EEH_File::convert_local_filepath_to_remote_filepath( $folder ) ) ) { |
|
211 | if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
212 | $msg = sprintf( __( '"%s" could not be created.', 'event_espresso' ), $folder ); |
|
213 | $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $folder ); |
|
214 | throw new EE_Error( $msg ); |
|
215 | } |
|
216 | return false; |
|
217 | } |
|
218 | EEH_File::add_htaccess_deny_from_all( $folder ); |
|
219 | } |
|
220 | } elseif ( ! EEH_File::verify_is_writable( $folder, 'folder' )) { |
|
221 | return false; |
|
222 | } |
|
@@ 265-277 (lines=13) @@ | ||
262 | $wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path ); |
|
263 | $full_file_path = EEH_File::standardise_directory_separators( $full_file_path ); |
|
264 | $parent_folder = EEH_File::get_parent_folder( $full_file_path ); |
|
265 | if ( ! EEH_File::exists( $full_file_path )) { |
|
266 | if( ! EEH_File::ensure_folder_exists_and_is_writable( $parent_folder ) ) { |
|
267 | return false; |
|
268 | } |
|
269 | if ( ! $wp_filesystem->touch( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ) ) { |
|
270 | if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
271 | $msg = sprintf( __( 'The "%s" file could not be created.', 'event_espresso' ), $full_file_path ); |
|
272 | $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path ); |
|
273 | throw new EE_Error( $msg ); |
|
274 | } |
|
275 | return false; |
|
276 | } |
|
277 | } |
|
278 | if ( ! EEH_File::verify_is_writable( $full_file_path, 'file' )) { |
|
279 | return false; |
|
280 | } |