@@ 114-124 (lines=11) @@ | ||
111 | */ |
|
112 | protected function isStrangeFilesArray($files_data) |
|
113 | { |
|
114 | if (!is_array($files_data)) { |
|
115 | throw new UnexpectedValueException( |
|
116 | sprintf( |
|
117 | esc_html__( |
|
118 | 'Unexpected PHP $_FILES data format. "%1$s" was expected to be an array.', |
|
119 | 'event_espresso' |
|
120 | ), |
|
121 | (string) $files_data |
|
122 | ) |
|
123 | ); |
|
124 | } |
|
125 | $first_value = reset($files_data); |
|
126 | if (!is_array($first_value)) { |
|
127 | throw new UnexpectedValueException( |
|
@@ 126-136 (lines=11) @@ | ||
123 | ); |
|
124 | } |
|
125 | $first_value = reset($files_data); |
|
126 | if (!is_array($first_value)) { |
|
127 | throw new UnexpectedValueException( |
|
128 | sprintf( |
|
129 | esc_html__( |
|
130 | 'Unexpected PHP $_FILES data format. "%1$s" was expected to be an array.', |
|
131 | 'event_espresso' |
|
132 | ), |
|
133 | (string) $first_value |
|
134 | ) |
|
135 | ); |
|
136 | } |
|
137 | $first_sub_array_item = reset($first_value); |
|
138 | if (is_array($first_sub_array_item)) { |
|
139 | // not just a 2d array |
|
@@ 207-217 (lines=11) @@ | ||
204 | */ |
|
205 | protected function createFileObjects($organized_files) |
|
206 | { |
|
207 | if (!is_array($organized_files)) { |
|
208 | throw new UnexpectedValueException( |
|
209 | sprintf( |
|
210 | esc_html__( |
|
211 | 'Unexpected PHP $organized_files data format. "%1$s" was expected to be an array.', |
|
212 | 'event_espresso' |
|
213 | ), |
|
214 | (string) $organized_files |
|
215 | ) |
|
216 | ); |
|
217 | } |
|
218 | $objs = []; |
|
219 | foreach ($organized_files as $key => $value) { |
|
220 | if (isset($value['name'], $value['tmp_name'], $value['size'])) { |