@@ -851,7 +851,7 @@ function sse_validate_file_extension( $file_path ) {
851851
852852/**
853853 * Validates and resolves parent directory for non-existent files.
854- *
854+ *
855855 * @param string $normalized_file_path The normalized file path.
856856 * @return string|false Resolved file path or false on failure.
857857 */
@@ -1400,9 +1400,9 @@ function sse_validate_download_file_data( $file_data ) {
14001400 */
14011401function sse_validate_download_file_access ( $ filepath ) {
14021402 // Security: Whitelist approach - only allow files in our controlled export directory.
1403- $ upload_dir = wp_upload_dir ();
1404- $ export_dir = trailingslashit ( $ upload_dir ['basedir ' ] ) . 'simple-wp-site-exporter-exports ' ;
1405-
1403+ $ upload_dir = wp_upload_dir ();
1404+ $ export_dir = trailingslashit ( $ upload_dir ['basedir ' ] ) . 'simple-wp-site-exporter-exports ' ;
1405+
14061406 // Security: Additional validation to prevent SSRF attacks.
14071407 // Ensure file extension is in our allowed list.
14081408 $ allowed_extensions = array ( 'zip ' , 'sql ' );
@@ -1480,7 +1480,7 @@ function sse_set_download_headers( $filename, $filesize ) {
14801480function sse_validate_file_output_security ( $ filepath ) {
14811481 // Security: Final validation before file output to prevent SSRF.
14821482 $ allowed_extensions = array ( 'zip ' , 'sql ' );
1483- $ file_extension = strtolower ( pathinfo ( $ filepath , PATHINFO_EXTENSION ) );
1483+ $ file_extension = strtolower ( pathinfo ( $ filepath , PATHINFO_EXTENSION ) );
14841484 if ( ! in_array ( $ file_extension , $ allowed_extensions , true ) ) {
14851485 sse_log ( 'Security: Blocked attempt to serve file with invalid extension: ' . $ file_extension , 'security ' );
14861486 wp_die ( esc_html__ ( 'Access denied - invalid file type. ' , 'simple-wp-site-exporter ' ) );
0 commit comments