| @@ -65,13 +65,21 @@ | ||
| 65 | 65 | $this->patterns[] = $pattern; |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | + /** | |
| 70 | + * Patterns are referenced by type only: their full data (elements included) is | |
| 71 | + * already localized once in builder.patterns. Embedding it here too doubled the | |
| 72 | + * inline yaymailData script to ~1MB, which some hosts truncate (ModSecurity | |
| 73 | + * response limits, pcre.backtrack_limit in HTML optimizers) and the SPA then | |
| 74 | + * never boots. SettingsPage::get_section_template_patterns_rehydrate_script() | |
| 75 | + * swaps the types back to the objects client-side before any bundle runs. | |
| 76 | + */ | |
| 69 | 77 | public function get_raw_data() { |
| 70 | 78 | $data = $this->get_data(); |
| 71 | 79 | $data['patterns'] = array_map( |
| 72 | 80 | function( BasePattern $item ) { |
| 73 | - return $item->get_raw_data(); | |
| 81 | + return $item->get_type(); | |
| 74 | 82 | }, |
| 75 | 83 | $data['patterns'] |
| 76 | 84 | ); |
| 77 | 85 | return $data; |