Skip to content

Commit 0a3e8f1

Browse files
committed
fix: Add default case to validate_file_to_edit() switch
The switch only handled codes 1 and 3 from validate_file(), but code 2 (absolute Windows drive paths) fell through without returning or dying. This caused PHPStan to warn about a missing return statement for the string|never return type.
1 parent 12a2bc5 commit 0a3e8f1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/wp-admin/includes/file.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ function validate_file_to_edit( $file, $allowed_files = array() ) {
751751
// wp_die( __('Sorry, cannot call files with their real path.' ));
752752

753753
case 3:
754+
default:
754755
wp_die( __( 'Sorry, that file cannot be edited.' ) );
755756
}
756757
}

0 commit comments

Comments
 (0)