|
49 | 49 | $t_path_config_names[] = 'absolute_path_default_upload_folder';
|
50 | 50 | }
|
51 | 51 |
|
| 52 | +# Build paths for all configs |
52 | 53 | $t_paths = array();
|
53 | 54 | foreach( $t_path_config_names as $t_path_config_name ) {
|
54 | 55 | $t_new_path = array();
|
|
57 | 58 | $t_paths[$t_path_config_name] = $t_new_path;
|
58 | 59 | }
|
59 | 60 |
|
| 61 | +# Trailing directory separator |
60 | 62 | foreach( $t_paths as $t_path_config_name => $t_path ) {
|
61 | 63 | check_print_test_row(
|
62 | 64 | $t_path_config_name . ' configuration option has a trailing directory separator',
|
63 | 65 | substr( $t_path['config_value'], -1, 1 ) == DIRECTORY_SEPARATOR,
|
64 |
| - array( false => 'You must provide a trailing directory separator (' . DIRECTORY_SEPARATOR . ') to the end of the ' . $t_path_config_name . ' configuration value.' ) |
| 66 | + array( false => |
| 67 | + "You must provide a trailing directory separator (" . DIRECTORY_SEPARATOR . |
| 68 | + ") to the end of '" . htmlspecialchars( $t_path['config_value'] ) . "'." |
| 69 | + ) ) |
65 | 70 | );
|
66 | 71 | }
|
67 | 72 |
|
| 73 | +# Is a directory |
68 | 74 | foreach( $t_paths as $t_path_config_name => $t_path ) {
|
69 | 75 | check_print_test_row(
|
70 | 76 | $t_path_config_name . ' configuration option points to a valid directory',
|
71 | 77 | is_dir( $t_path['config_value'] ),
|
72 |
| - array( false => 'The path specified by the ' . $t_path_config_name . ' configuration option does not point to a valid and accessible directory.' ) |
| 78 | + array( false => |
| 79 | + "The path '" . htmlspecialchars( $t_path['config_value'] ) . |
| 80 | + "' is not a valid directory." |
| 81 | + ) |
| 82 | + ); |
| 83 | +} |
| 84 | + |
| 85 | +# Is readable |
| 86 | +foreach( $t_paths as $t_path_config_name => $t_path ) { |
| 87 | + check_print_test_row( |
| 88 | + $t_path_config_name . ' configuration option points to an accessible directory', |
| 89 | + is_readable( $t_path['config_value'] ), |
| 90 | + array( false => |
| 91 | + "The path '" . htmlspecialchars( $t_path['config_value'] ) . |
| 92 | + "' is not accessible." |
| 93 | + ) |
73 | 94 | );
|
74 | 95 | }
|
75 | 96 |
|
|
80 | 101 | check_print_test_row(
|
81 | 102 | $t_path_config_name . ' configuration option points to a writable directory',
|
82 | 103 | is_writable( $t_path['config_value'] ),
|
83 |
| - array( false => "The path specified by the $t_path_config_name configuration option ('" . $t_path['config_value'] . "') must be writable." ) |
| 104 | + array( false => |
| 105 | + "The path '" . htmlspecialchars( $t_path['config_value'] ) . "' must be writable." |
| 106 | + ) |
84 | 107 | );
|
85 | 108 | }
|
86 | 109 |
|
|
0 commit comments