← All changes
|
inc/3rd-party/nextgen-gallery/classes/Optimization/Data/NGG.php
+12
-1
2.3.0
→
trunk
View file →
| @@ -156,12 +156,23 @@ | ||
| 156 | 156 | if ( ! $data['success'] ) { |
| 157 | 157 | /** |
| 158 | 158 | * Error. |
| 159 | 159 | */ |
| 160 | - $old_data['data']['sizes'][ $size ] = [ | |
| 160 | + $size_data = [ | |
| 161 | 161 | 'success' => false, |
| 162 | 162 | 'error' => $data['error'], |
| 163 | 163 | ]; |
| 164 | + | |
| 165 | + if ( ! empty( $data['permanent_error'] ) ) { | |
| 166 | + /** | |
| 167 | + * `permanent_error` is written as the FIRST key on purpose: the bulk query matches the | |
| 168 | + * serialized data with a LIKE on the `<size>";a:3:{s:15:"permanent_error";b:1;` prefix, | |
| 169 | + * which only stays deterministic if the key order does. | |
| 170 | + */ | |
| 171 | + $size_data = array_merge( [ 'permanent_error' => true ], $size_data ); | |
| 172 | + } | |
| 173 | + | |
| 174 | + $old_data['data']['sizes'][ $size ] = $size_data; | |
| 164 | 175 | } else { |
| 165 | 176 | /** |
| 166 | 177 | * Success. |
| 167 | 178 | */ |