| @@ -104,12 +104,23 @@ | ||
| 104 | 104 | if ( ! $data['success'] ) { |
| 105 | 105 | /** |
| 106 | 106 | * Error. |
| 107 | 107 | */ |
| 108 | - $old_data['sizes'][ $size ] = [ | |
| 108 | + $size_data = [ | |
| 109 | 109 | 'success' => false, |
| 110 | 110 | 'error' => $data['error'], |
| 111 | 111 | ]; |
| 112 | + | |
| 113 | + if ( ! empty( $data['permanent_error'] ) ) { | |
| 114 | + /** | |
| 115 | + * `permanent_error` is written as the FIRST key on purpose: the bulk queries match the | |
| 116 | + * serialized meta value with a LIKE on the `<size>";a:3:{s:15:"permanent_error";b:1;` | |
| 117 | + * prefix, which only stays deterministic if the key order does. | |
| 118 | + */ | |
| 119 | + $size_data = array_merge( [ 'permanent_error' => true ], $size_data ); | |
| 120 | + } | |
| 121 | + | |
| 122 | + $old_data['sizes'][ $size ] = $size_data; | |
| 112 | 123 | } else { |
| 113 | 124 | /** |
| 114 | 125 | * Success. |
| 115 | 126 | */ |