Orbit Fox by ThemeIsle - Version 2.10.0

Version Description

Download this release

Release Info

Developer themeisle
Plugin Icon 128x128 Orbit Fox by ThemeIsle
Version 2.10.0
Comparing to
See all releases

Code changes from version 2.9.19 to 2.10.0

Files changed (82) hide show
  1. CHANGELOG.md +4 -0
  2. core/app/class-orbit-fox-global-settings.php +1 -0
  3. core/includes/class-orbit-fox.php +1 -1
  4. obfx_modules/custom-fonts/css/admin.css +13 -0
  5. obfx_modules/custom-fonts/custom_fonts_admin.php +407 -0
  6. obfx_modules/custom-fonts/custom_fonts_public.php +249 -0
  7. obfx_modules/custom-fonts/init.php +154 -0
  8. obfx_modules/custom-fonts/js/admin.js +71 -0
  9. readme.md +7 -0
  10. readme.txt +7 -0
  11. themeisle-companion.php +1 -1
  12. vendor/autoload.php +1 -1
  13. vendor/clue/stream-filter/CHANGELOG.md +12 -0
  14. vendor/clue/stream-filter/README.md +38 -16
  15. vendor/clue/stream-filter/examples/base64_decode.php +0 -29
  16. vendor/clue/stream-filter/examples/base64_encode.php +0 -21
  17. vendor/clue/stream-filter/examples/uppercase.php +0 -9
  18. vendor/clue/stream-filter/phpunit.xml.dist +0 -19
  19. vendor/clue/stream-filter/src/CallbackFilter.php +19 -25
  20. vendor/clue/stream-filter/src/functions.php +212 -31
  21. vendor/clue/stream-filter/src/functions_include.php +2 -1
  22. vendor/composer/autoload_classmap.php +5 -0
  23. vendor/composer/autoload_real.php +7 -7
  24. vendor/composer/autoload_static.php +9 -4
  25. vendor/composer/installed.json +34 -26
  26. vendor/guzzlehttp/psr7/CHANGELOG.md +25 -1
  27. vendor/guzzlehttp/psr7/README.md +193 -129
  28. vendor/guzzlehttp/psr7/src/AppendStream.php +4 -1
  29. vendor/guzzlehttp/psr7/src/BufferStream.php +3 -0
  30. vendor/guzzlehttp/psr7/src/CachingStream.php +2 -1
  31. vendor/guzzlehttp/psr7/src/DroppingStream.php +1 -0
  32. vendor/guzzlehttp/psr7/src/FnStream.php +2 -0
  33. vendor/guzzlehttp/psr7/src/Header.php +71 -0
  34. vendor/guzzlehttp/psr7/src/InflateStream.php +1 -0
  35. vendor/guzzlehttp/psr7/src/LazyOpenStream.php +2 -1
  36. vendor/guzzlehttp/psr7/src/LimitStream.php +1 -0
  37. vendor/guzzlehttp/psr7/src/Message.php +252 -0
  38. vendor/guzzlehttp/psr7/src/MessageTrait.php +4 -3
  39. vendor/guzzlehttp/psr7/src/MimeType.php +140 -0
  40. vendor/guzzlehttp/psr7/src/MultipartStream.php +6 -5
  41. vendor/guzzlehttp/psr7/src/NoSeekStream.php +1 -0
  42. vendor/guzzlehttp/psr7/src/PumpStream.php +4 -1
  43. vendor/guzzlehttp/psr7/src/Query.php +108 -0
  44. vendor/guzzlehttp/psr7/src/Request.php +2 -1
  45. vendor/guzzlehttp/psr7/src/Response.php +3 -2
  46. vendor/guzzlehttp/psr7/src/ServerRequest.php +3 -1
  47. vendor/guzzlehttp/psr7/src/Stream.php +6 -3
  48. vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +3 -1
  49. vendor/guzzlehttp/psr7/src/StreamWrapper.php +2 -0
  50. vendor/guzzlehttp/psr7/src/UploadedFile.php +10 -1
  51. vendor/guzzlehttp/psr7/src/Uri.php +1 -0
  52. vendor/guzzlehttp/psr7/src/UriNormalizer.php +1 -0
  53. vendor/guzzlehttp/psr7/src/UriResolver.php +1 -0
  54. vendor/guzzlehttp/psr7/src/Utils.php +398 -0
  55. vendor/guzzlehttp/psr7/src/functions.php +130 -612
  56. vendor/masterminds/html5/.php_cs.dist +0 -14
  57. vendor/masterminds/html5/.scrutinizer.yml +0 -41
  58. vendor/masterminds/html5/RELEASE.md +6 -0
  59. vendor/masterminds/html5/example.php +0 -32
  60. vendor/masterminds/html5/phpunit.xml.dist +0 -17
  61. vendor/masterminds/html5/sami.php +0 -10
  62. vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php +1 -1
  63. vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php +3 -8
  64. vendor/masterminds/html5/test/HTML5/ElementsTest.php +0 -485
  65. vendor/masterminds/html5/test/HTML5/Fixtures/encoding/utf-8.html +0 -9
  66. vendor/masterminds/html5/test/HTML5/Fixtures/encoding/windows-1252.html +0 -9
  67. vendor/masterminds/html5/test/HTML5/Html5Test.html +0 -10
  68. vendor/masterminds/html5/test/HTML5/Html5Test.php +0 -483
  69. vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php +0 -44
  70. vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php +0 -743
  71. vendor/masterminds/html5/test/HTML5/Parser/EventStack.php +0 -116
  72. vendor/masterminds/html5/test/HTML5/Parser/EventStackError.php +0 -7
  73. vendor/masterminds/html5/test/HTML5/Parser/InstructionProcessorMock.php +0 -26
  74. vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php +0 -184
  75. vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php +0 -981
  76. vendor/masterminds/html5/test/HTML5/Parser/TreeBuildingRulesTest.php +0 -118
  77. vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php +0 -28
  78. vendor/masterminds/html5/test/HTML5/Serializer/OutputRulesTest.php +0 -652
  79. vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php +0 -136
  80. vendor/masterminds/html5/test/HTML5/TestCase.php +0 -28
  81. vendor/masterminds/html5/test/benchmark/example.html +0 -6403
  82. vendor/masterminds/html5/test/benchmark/run.php +0 -29
CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  ##### [Version 2.9.19](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.18...v2.9.19) (2020-09-25)
2
 
3
  * Fix elementor post grid jQuery dependencies
1
+ #### [Version 2.10.0](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.19...v2.10.0) (2020-10-09)
2
+
3
+ - New Custom Fonts module
4
+
5
  ##### [Version 2.9.19](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.18...v2.9.19) (2020-09-25)
6
 
7
  * Fix elementor post grid jQuery dependencies
core/app/class-orbit-fox-global-settings.php CHANGED
@@ -73,6 +73,7 @@ class Orbit_Fox_Global_Settings {
73
  'policy-notice',
74
  'beaver-widgets',
75
  'header-footer-scripts',
 
76
  )
77
  );
78
  }// End if().
73
  'policy-notice',
74
  'beaver-widgets',
75
  'header-footer-scripts',
76
+ 'custom-fonts',
77
  )
78
  );
79
  }// End if().
core/includes/class-orbit-fox.php CHANGED
@@ -69,7 +69,7 @@ class Orbit_Fox {
69
 
70
  $this->plugin_name = 'orbit-fox';
71
 
72
- $this->version = '2.9.19';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
69
 
70
  $this->plugin_name = 'orbit-fox';
71
 
72
+ $this->version = '2.10.0';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
obfx_modules/custom-fonts/css/admin.css ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .obfx-custom-fonts-file-wrap.form-field{
2
+ position: relative;
3
+ margin: 1.5em 0;
4
+ }
5
+ .obfx-custom-fonts-upload.button {
6
+ float: right;
7
+ margin-right: 5%;
8
+ margin-top: 2px;
9
+ }
10
+
11
+ .obfx-custom-font-select-field {
12
+ width: 95%;
13
+ }
obfx_modules/custom-fonts/custom_fonts_admin.php ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ * Class Custom_Fonts_Admin
8
+ */
9
+ class Custom_Fonts_Admin {
10
+
11
+ /**
12
+ * Create custom fonts taxonomy.
13
+ *
14
+ * @since 2.10
15
+ * @return void
16
+ */
17
+ public function create_taxonomy() {
18
+ $labels = array(
19
+ 'name' => __( 'Custom Fonts', 'themeisle-companion' ),
20
+ 'singular_name' => __( 'Font', 'themeisle-companion' ),
21
+ 'menu_name' => _x( 'Custom Fonts', 'Admin menu name', 'themeisle-companion' ),
22
+ 'search_items' => __( 'Search Fonts', 'themeisle-companion' ),
23
+ 'all_items' => __( 'All Fonts', 'themeisle-companion' ),
24
+ 'parent_item' => __( 'Parent Font', 'themeisle-companion' ),
25
+ 'parent_item_colon' => __( 'Parent Font:', 'themeisle-companion' ),
26
+ 'edit_item' => __( 'Edit Font', 'themeisle-companion' ),
27
+ 'update_item' => __( 'Update Font', 'themeisle-companion' ),
28
+ 'add_new_item' => __( 'Add New Font', 'themeisle-companion' ),
29
+ 'new_item_name' => __( 'New Font Name', 'themeisle-companion' ),
30
+ 'not_found' => __( 'No fonts found', 'themeisle-companion' ),
31
+ );
32
+
33
+ $args = array(
34
+ 'hierarchical' => false,
35
+ 'labels' => $labels,
36
+ 'public' => false,
37
+ 'show_in_nav_menus' => false,
38
+ 'show_ui' => true,
39
+ 'capabilities' => array( 'edit_theme_options' ),
40
+ 'query_var' => false,
41
+ 'rewrite' => false,
42
+ );
43
+
44
+ register_taxonomy(
45
+ 'obfx_custom_fonts',
46
+ array(),
47
+ $args
48
+ );
49
+ }
50
+
51
+ /**
52
+ * Add custom fonts taxonomy to menu.
53
+ *
54
+ * @since 2.10
55
+ * @return void
56
+ */
57
+ public function add_to_menu() {
58
+ add_submenu_page(
59
+ 'themes.php',
60
+ __( 'Custom Fonts', 'themeisle-companion' ),
61
+ __( 'Custom Fonts', 'themeisle-companion' ),
62
+ 'edit_theme_options',
63
+ 'edit-tags.php?taxonomy=obfx_custom_fonts'
64
+ );
65
+ }
66
+
67
+ /**
68
+ * Edit custom font form fields.
69
+ * It hides the description and slug fields and it changes the description for the name field.
70
+ *
71
+ * @since 2.10
72
+ * @return void
73
+ */
74
+ public function edit_custom_font_form() {
75
+ global $parent_file, $submenu_file;
76
+
77
+ if ( 'edit-tags.php?taxonomy=obfx_custom_fonts' === $submenu_file ) {
78
+ $parent_file = 'themes.php'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
79
+ }
80
+ if ( get_current_screen()->id != 'edit-obfx_custom_fonts' ) {
81
+ return;
82
+ } ?>
83
+ <style>#addtag div.form-field.term-slug-wrap, #edittag tr.form-field.term-slug-wrap { display: none; }
84
+ #addtag div.form-field.term-description-wrap, #edittag tr.form-field.term-description-wrap { display: none; }</style><script>jQuery( document ).ready( function( $ ) {
85
+ var $wrapper = $( '#addtag, #edittag' );
86
+ $wrapper.find( 'tr.form-field.term-name-wrap p, div.form-field.term-name-wrap > p' ).text( '<?php esc_html_e( 'The name of the font as it appears in the customizer options.', 'themeisle-companion' ); ?>' );
87
+ } );
88
+ </script>
89
+ <?php
90
+ }
91
+
92
+ /**
93
+ * Manage custom fonts taxonomy columns.
94
+ *
95
+ * @param array $columns Default columns.
96
+ *
97
+ * @since 2.10
98
+ * @return array
99
+ */
100
+ public function manage_columns( $columns ) {
101
+ unset( $columns['slug'] );
102
+ unset( $columns['description'] );
103
+ unset( $columns['posts'] );
104
+ return $columns;
105
+ }
106
+
107
+ /**
108
+ * Add new Taxonomy data
109
+ *
110
+ * @since 2.10
111
+ * @return void
112
+ */
113
+ public function add_new_taxonomy_data() {
114
+ $this->font_file_new_field( 'font_woff_2', __( 'Font .woff2', 'themeisle-companion' ), __( 'Upload the font\'s woff2 file or enter the URL.', 'themeisle-companion' ) );
115
+ $this->font_file_new_field( 'font_woff', __( 'Font .woff', 'themeisle-companion' ), __( 'Upload the font\'s woff file or enter the URL.', 'themeisle-companion' ) );
116
+ $this->font_file_new_field( 'font_ttf', __( 'Font .ttf', 'themeisle-companion' ), __( 'Upload the font\'s ttf file or enter the URL.', 'themeisle-companion' ) );
117
+ $this->font_file_new_field( 'font_eot', __( 'Font .eot', 'themeisle-companion' ), __( 'Upload the font\'s eot file or enter the URL.', 'themeisle-companion' ) );
118
+ $this->font_file_new_field( 'font_svg', __( 'Font .svg', 'themeisle-companion' ), __( 'Upload the font\'s svg file or enter the URL.', 'themeisle-companion' ) );
119
+ $this->font_file_new_field( 'font_otf', __( 'Font .otf', 'themeisle-companion' ), __( 'Upload the font\'s otf file or enter the URL.', 'themeisle-companion' ) );
120
+
121
+ $this->select_new_field(
122
+ 'font-display',
123
+ __( 'Font Display', 'themeisle-companion' ),
124
+ __( 'Select font-display property for this font', 'themeisle-companion' ),
125
+ array(
126
+ 'auto' => 'auto',
127
+ 'block' => 'block',
128
+ 'swap' => 'swap',
129
+ 'fallback' => 'fallback',
130
+ 'optional' => 'optional',
131
+ )
132
+ );
133
+ }
134
+
135
+ /**
136
+ * Add Taxonomy data field
137
+ *
138
+ * @param int $id current term id.
139
+ * @param string $title font type title.
140
+ * @param string $description title font type description.
141
+ * @param string $value title font type meta values.
142
+ *
143
+ * @since 2.10
144
+ * @return void
145
+ */
146
+ protected function font_file_new_field( $id, $title, $description, $value = '' ) {
147
+ echo '<div class="obfx-custom-fonts-file-wrap form-field term-' . esc_attr( $id ) . '-wrap" >';
148
+ echo '<label for="font-' . esc_attr( $id ) . '">';
149
+ echo esc_html( $title );
150
+ echo '</label>';
151
+ echo '<input type="text" id="font-' . esc_attr( $id ) . '" class="obfx-custom-fonts-link ' . esc_attr( $id ) . '" name=" obfx_custom_fonts[' . esc_attr( $id ) . ']" value="' . esc_attr( $value ) . '" />';
152
+ echo '<a href="#" class="obfx-custom-fonts-upload button" data-upload-type="' . esc_attr( $id ) . '">';
153
+ esc_html_e( 'Upload', 'themeisle-companion' );
154
+ echo '</a>';
155
+ echo '<p>' . esc_html( $description ) . '</p>';
156
+ echo '</div>';
157
+ }
158
+
159
+ /**
160
+ * Render select field for the new font screen.
161
+ *
162
+ * @param string $id Field ID.
163
+ * @param string $title Field Title.
164
+ * @param string $description Field Description.
165
+ * @param array $select_fields Select fields as Array.
166
+ *
167
+ * @since 2.10
168
+ * @return void
169
+ */
170
+ protected function select_new_field( $id, $title, $description, $select_fields ) {
171
+ echo '<div class="obfx-custom-fonts-file-wrap form-field term-' . esc_attr( $id ) . '-wrap" >';
172
+ echo '<label for="font-' . esc_attr( $id ) . '">' . esc_html( $title ) . '</label>';
173
+ echo '<select type="select" id="font-' . esc_attr( $id ) . '" class="obfx-custom-font-select-field ' . esc_attr( $id ) . '" name="obfx_custom_fonts[' . esc_attr( $id ) . ']" />';
174
+ foreach ( $select_fields as $key => $value ) {
175
+ echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
176
+ }
177
+ echo '</select>';
178
+ echo '</div>';
179
+ }
180
+
181
+ /**
182
+ * Edit Taxonomy data
183
+ *
184
+ * @param object $term taxonomy terms.
185
+ *
186
+ * @since 2.10
187
+ * @return void
188
+ */
189
+ public function edit_taxonomy_data( $term ) {
190
+ $data = self::get_font_links( $term->term_id );
191
+ $this->font_file_edit_field( 'font_woff_2', __( 'Font .woff2', 'themeisle-companion' ), $data['font_woff_2'], __( 'Upload the font\'s woff2 file or enter the URL.', 'themeisle-companion' ) );
192
+ $this->font_file_edit_field( 'font_woff', __( 'Font .woff', 'themeisle-companion' ), $data['font_woff'], __( 'Upload the font\'s woff file or enter the URL.', 'themeisle-companion' ) );
193
+ $this->font_file_edit_field( 'font_ttf', __( 'Font .ttf', 'themeisle-companion' ), $data['font_ttf'], __( 'Upload the font\'s ttf file or enter the URL.', 'themeisle-companion' ) );
194
+ $this->font_file_edit_field( 'font_eot', __( 'Font .eot', 'themeisle-companion' ), $data['font_eot'], __( 'Upload the font\'s eot file or enter the URL.', 'themeisle-companion' ) );
195
+ $this->font_file_edit_field( 'font_svg', __( 'Font .svg', 'themeisle-companion' ), $data['font_svg'], __( 'Upload the font\'s svg file or enter the URL.', 'themeisle-companion' ) );
196
+ $this->font_file_edit_field( 'font_otf', __( 'Font .otf', 'themeisle-companion' ), $data['font_otf'], __( 'Upload the font\'s otf file or enter the URL.', 'themeisle-companion' ) );
197
+
198
+ $this->select_edit_field(
199
+ 'font-display',
200
+ __( 'Font Display', 'themeisle-companion' ),
201
+ $data['font-display'],
202
+ __( 'Select font-display property for this font', 'themeisle-companion' ),
203
+ array(
204
+ 'auto' => 'Auto',
205
+ 'block' => 'Block',
206
+ 'swap' => 'Swap',
207
+ 'fallback' => 'Fallback',
208
+ 'optional' => 'Optional',
209
+ )
210
+ );
211
+ }
212
+
213
+ /**
214
+ * Add Taxonomy data field
215
+ *
216
+ * @param int $id current term id.
217
+ * @param string $title font type title.
218
+ * @param string $value title font type meta values.
219
+ * @param string $description title font type description.
220
+ *
221
+ * @since 2.10
222
+ * @return void
223
+ */
224
+ protected function font_file_edit_field( $id, $title, $value = '', $description ) {
225
+ echo '<tr class="obfx-custom-fonts-file-wrap form-field term-' . esc_attr( $id ) . '-wrap ">';
226
+ echo '<th scope="row">';
227
+ echo '<label for="metadata-' . esc_attr( $id ) . '">';
228
+ echo esc_html( $title );
229
+ echo '</label>';
230
+ echo '</th>';
231
+ echo '<td>';
232
+ echo '<input id="metadata-' . esc_attr( $id ) . '" type="text" class="obfx-custom-fonts-link ' . esc_attr( $id ) . '" name="obfx_custom_fonts[' . esc_attr( $id ) . ']" value="' . esc_attr( $value ) . '" />';
233
+ echo '<a href="#" class="obfx-custom-fonts-upload button" data-upload-type="' . esc_attr( $id ) . '">';
234
+ esc_html_e( 'Upload', 'themeisle-companion' );
235
+ echo '</a>';
236
+ echo '<p>';
237
+ echo esc_html( $description );
238
+ echo '</p>';
239
+ echo '</td>';
240
+ echo '</tr>';
241
+ }
242
+
243
+ /**
244
+ * Render select field for the edit font screen.
245
+ *
246
+ * @param string $id Field ID.
247
+ * @param string $title Field Title.
248
+ * @param string $saved_val Field Value.
249
+ * @param string $description Field Description.
250
+ * @param array $select_fields Select fields as Array.
251
+ *
252
+ * @since 2.10
253
+ * @return void
254
+ */
255
+ private function select_edit_field( $id, $title, $saved_val = '', $description, $select_fields ) {
256
+ echo '<tr class="obfx-custom-fonts-file-wrap form-field term-' . esc_attr( $id ) . '-wrap">';
257
+ echo '<th scope="row">';
258
+ echo '<label for="metadata-' . esc_attr( $id ) . '">';
259
+ echo esc_html( $title );
260
+ echo '</label>';
261
+ echo '</th>';
262
+ echo '<td>';
263
+ echo '<select type="select" id="font-' . esc_attr( $id ) . '" class="obfx-custom-font-select-field ' . esc_attr( $id ) . '" name="obfx_custom_fonts[' . esc_attr( $id ) . ']" />';
264
+ foreach ( $select_fields as $key => $value ) {
265
+ echo '<option value="' . esc_attr( $key ) . '" ' . selected( $key, $saved_val ) . '>';
266
+ echo esc_html( $value );
267
+ echo '</option>';
268
+ }
269
+ echo '</select>';
270
+ echo '<p>';
271
+ echo esc_html( $description );
272
+ echo '</p>';
273
+ echo '</td>';
274
+ echo '</tr>';
275
+ }
276
+
277
+ /**
278
+ * Save Taxonomy meta data value
279
+ *
280
+ * @param int $term_id current term id.
281
+ *
282
+ * @since 2.10
283
+ * @return bool
284
+ */
285
+ public function save_metadata( $term_id ) {
286
+
287
+ if ( ! current_user_can( 'manage_options' ) ) {
288
+ return false;
289
+ }
290
+
291
+ if ( isset( $_POST['obfx_custom_fonts'] ) ) {// phpcs:ignore WordPress.Security.NonceVerification.Missing
292
+ $return_val = array();
293
+ foreach ( $_POST['obfx_custom_fonts'] as $key => $value ) {
294
+ if ( $key === 'font-display' ) {
295
+ $return_val[ $key ] = esc_attr( $value );
296
+ continue;
297
+ }
298
+ $return_val[ $key ] = esc_url( $value );
299
+ }
300
+ self::update_font_links( $return_val, $term_id );
301
+ }
302
+
303
+ return true;
304
+ }
305
+
306
+ /**
307
+ * Update font data from name
308
+ *
309
+ * @param array $posted custom font data.
310
+ * @param int $term_id custom font term id.
311
+ *
312
+ * @since 2.10
313
+ * @return void
314
+ */
315
+ public static function update_font_links( $posted, $term_id ) {
316
+
317
+ $links = self::get_font_links( $term_id );
318
+ foreach ( array_keys( $links ) as $key ) {
319
+ if ( isset( $posted[ $key ] ) ) {
320
+ $links[ $key ] = $posted[ $key ];
321
+ } else {
322
+ $links[ $key ] = '';
323
+ }
324
+ }
325
+ update_option( "taxonomy_obfx_custom_fonts_{$term_id}", $links );
326
+ }
327
+
328
+ /**
329
+ * Get font links
330
+ *
331
+ * @param int $term_id custom font term id.
332
+ *
333
+ * @since 2.10
334
+ * @return array
335
+ */
336
+ public static function get_font_links( $term_id ) {
337
+ $links = get_option( "taxonomy_obfx_custom_fonts_{$term_id}", array() );
338
+ return self::default_args( $links );
339
+ }
340
+
341
+ /**
342
+ * Default fonts
343
+ *
344
+ * @param array $fonts fonts array of fonts.
345
+ *
346
+ * @since 2.10
347
+ * @return array
348
+ */
349
+ protected static function default_args( $fonts ) {
350
+ return wp_parse_args(
351
+ $fonts,
352
+ array(
353
+ 'font_woff_2' => '',
354
+ 'font_woff' => '',
355
+ 'font_ttf' => '',
356
+ 'font_svg' => '',
357
+ 'font_eot' => '',
358
+ 'font_otf' => '',
359
+ 'font-display' => 'swap',
360
+ )
361
+ );
362
+ }
363
+
364
+ /**
365
+ * Allowed mime types and file extensions
366
+ *
367
+ * @param array $mimes Current array of mime types.
368
+ *
369
+ * @since 2.10
370
+ * @return array
371
+ */
372
+ public function add_fonts_to_allowed_mimes( $mimes ) {
373
+ $mimes['woff'] = 'application/x-font-woff';
374
+ $mimes['woff2'] = 'application/x-font-woff2';
375
+ $mimes['ttf'] = 'application/x-font-ttf';
376
+ $mimes['svg'] = 'image/svg+xml';
377
+ $mimes['eot'] = 'application/vnd.ms-fontobject';
378
+ $mimes['otf'] = 'font/otf';
379
+
380
+ return $mimes;
381
+ }
382
+
383
+ /**
384
+ * Correct the mome types and extension for the font types.
385
+ *
386
+ * @param array $defaults File data array containing 'ext', 'type', and 'proper_filename' keys.
387
+ * @param string $file Full path to the file.
388
+ * @param string $filename The name of the file (may differ from $file due to
389
+ * $file being in a tmp directory).
390
+ * @since 2.10
391
+ * @return array
392
+ */
393
+ public function update_mime_types( $defaults, $file, $filename ) {
394
+ if ( 'ttf' === pathinfo( $filename, PATHINFO_EXTENSION ) ) {
395
+ $defaults['type'] = 'application/x-font-ttf';
396
+ $defaults['ext'] = 'ttf';
397
+ }
398
+
399
+ if ( 'otf' === pathinfo( $filename, PATHINFO_EXTENSION ) ) {
400
+ $defaults['type'] = 'application/x-font-otf';
401
+ $defaults['ext'] = 'otf';
402
+ }
403
+
404
+ return $defaults;
405
+ }
406
+
407
+ }
obfx_modules/custom-fonts/custom_fonts_public.php ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ * Class Custom_Fonts_Public
8
+ */
9
+ class Custom_Fonts_Public {
10
+
11
+ /**
12
+ * Member Varible
13
+ *
14
+ * @since 2.10
15
+ * @var string
16
+ */
17
+ protected $font_css = '';
18
+
19
+ /**
20
+ * Fonts
21
+ *
22
+ * @since 2.10
23
+ * @var array
24
+ */
25
+ private $fonts = array();
26
+
27
+ /**
28
+ * Filter NeveReactCustomize object to add custom fonts.
29
+ *
30
+ * @param $localized_data
31
+ *
32
+ * @since 2.10
33
+ * @return array
34
+ */
35
+ public function add_custom_fonts( $localized_data ) {
36
+ $localized_data['fonts']['Custom'] = $this->get_fonts();
37
+ return $localized_data;
38
+ }
39
+
40
+ /**
41
+ * Get fonts
42
+ *
43
+ * @since 2.10
44
+ * @return array
45
+ */
46
+ public function get_fonts() {
47
+ if ( ! empty( $this->fonts ) ) {
48
+ return $this->fonts;
49
+ }
50
+
51
+ $terms = get_terms(
52
+ 'obfx_custom_fonts',
53
+ array(
54
+ 'hide_empty' => false,
55
+ )
56
+ );
57
+
58
+ if ( ! empty( $terms ) ) {
59
+ foreach ( $terms as $term ) {
60
+ if ( ! is_object( $term ) || ! property_exists( $term, 'name' ) ) {
61
+ return $this->fonts;
62
+ }
63
+ $this->fonts[] = $term->name;
64
+ }
65
+ }
66
+
67
+ return $this->fonts;
68
+ }
69
+
70
+ /**
71
+ * Enqueue Scripts
72
+ *
73
+ * @since 2.10
74
+ * @return void
75
+ */
76
+ public function add_style() {
77
+ $fonts = $this->get_fonts();
78
+ if ( ! empty( $fonts ) ) {
79
+ foreach ( $fonts as $load_font_name ) {
80
+ $this->render_font_css( $load_font_name );
81
+ }
82
+ ?>
83
+ <style type="text/css">
84
+ <?php echo wp_strip_all_tags( $this->font_css ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
85
+ </style>
86
+ <?php
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Get font data from name
92
+ *
93
+ * @param string $name custom font name.
94
+ *
95
+ * @since 2.10
96
+ * @return array
97
+ */
98
+ public static function get_links_by_name( $name ) {
99
+
100
+ $terms = get_terms(
101
+ 'obfx_custom_fonts',
102
+ array(
103
+ 'hide_empty' => false,
104
+ )
105
+ );
106
+ $font_links = array();
107
+ if ( ! empty( $terms ) ) {
108
+
109
+ foreach ( $terms as $term ) {
110
+ if ( $term->name == $name ) {
111
+ $font_links[ $term->name ] = Custom_Fonts_Admin::get_font_links( $term->term_id );
112
+ }
113
+ }
114
+ }
115
+
116
+ return $font_links;
117
+
118
+ }
119
+
120
+ /**
121
+ * Create css for font-face
122
+ *
123
+ * @param array $font selected font from custom font list.
124
+ *
125
+ * @since 2.10
126
+ * @return void
127
+ */
128
+ private function render_font_css( $font ) {
129
+ $fonts = $this->get_links_by_name( $font );
130
+
131
+ foreach ( $fonts as $font => $links ) :
132
+ $css = '@font-face { font-family:' . esc_attr( $font ) . ';';
133
+ $css .= 'src:';
134
+ $arr = array();
135
+ if ( $links['font_woff_2'] ) {
136
+ $arr[] = 'url(' . esc_url( $links['font_woff_2'] ) . ") format('woff2')";
137
+ }
138
+ if ( $links['font_woff'] ) {
139
+ $arr[] = 'url(' . esc_url( $links['font_woff'] ) . ") format('woff')";
140
+ }
141
+ if ( $links['font_ttf'] ) {
142
+ $arr[] = 'url(' . esc_url( $links['font_ttf'] ) . ") format('truetype')";
143
+ }
144
+ if ( $links['font_otf'] ) {
145
+ $arr[] = 'url(' . esc_url( $links['font_otf'] ) . ") format('opentype')";
146
+ }
147
+ if ( $links['font_svg'] ) {
148
+ $arr[] = 'url(' . esc_url( $links['font_svg'] ) . '#' . esc_attr( strtolower( str_replace( ' ', '_', $font ) ) ) . ") format('svg')";
149
+ }
150
+ $css .= join( ', ', $arr );
151
+ $css .= ';';
152
+ $css .= 'font-display: ' . esc_attr( $links['font-display'] ) . ';';
153
+ $css .= '}';
154
+ endforeach;
155
+
156
+ $this->font_css .= $css;
157
+ }
158
+
159
+ /**
160
+ * Set default 'inherit' if custom font is selected in customizer if this is deleted.
161
+ *
162
+ * @param int $term Term ID.
163
+ * @param int $tt_id Term taxonomy ID.
164
+ * @param string $taxonomy Taxonomy slug.
165
+ * @param mixed $deleted_term deleted term.
166
+ * @param object $object_ids objects ids.
167
+ *
168
+ * @since 2.10
169
+ * @return bool
170
+ */
171
+ public function delete_custom_fonts_fallback( $term, $tt_id, $taxonomy, $deleted_term, $object_ids ) {
172
+ if ( $taxonomy !== 'obfx_custom_fonts' ) {
173
+ return false;
174
+ }
175
+ if ( ! defined( 'NEVE_VERSION' ) ) {
176
+ return false;
177
+ }
178
+ $theme_mods = array( 'neve_body_font_family', 'neve_headings_font_family', 'primary-menu_component_font_family', 'footer_copyright_component_font_family' );
179
+ foreach ( $theme_mods as $theme_mod ) {
180
+ $value = get_theme_mod( $theme_mod );
181
+ if ( $value === $deleted_term->name ) {
182
+ set_theme_mod( $theme_mod, '' );
183
+ }
184
+ }
185
+ return true;
186
+ }
187
+
188
+ /**
189
+ * Add Custom Font list to BB theme and BB Page Builder
190
+ *
191
+ * @param array $bb_fonts font families added by bb.
192
+ *
193
+ * @since 2.10
194
+ * @return array
195
+ */
196
+ public function bb_custom_fonts( $bb_fonts ) {
197
+
198
+ $fonts = $this->get_fonts();
199
+ $custom_fonts = array();
200
+ if ( ! empty( $fonts ) ) {
201
+ foreach ( $fonts as $font_family_name ) {
202
+ $custom_fonts[ $font_family_name ] = array(
203
+ 'fallback' => 'Verdana, Arial, sans-serif',
204
+ 'weights' => array( '100', '200', '300', '400', '500', '600', '700', '800', '900' ),
205
+ );
206
+ }
207
+ }
208
+
209
+ return array_merge( $bb_fonts, $custom_fonts );
210
+ }
211
+
212
+ /**
213
+ * Add Custom Font group to elementor font list.
214
+ * Group name "Custom" is added as the first element in the array.
215
+ *
216
+ * @param array $font_groups default font groups in elementor.
217
+ *
218
+ * @since 2.10
219
+ * @return array
220
+ */
221
+ public function elementor_group( $font_groups ) {
222
+ $new_group['obfx-custom-fonts'] = __( 'Custom', 'themeisle-companion' );
223
+ $font_groups = $new_group + $font_groups;
224
+
225
+ return $font_groups;
226
+ }
227
+
228
+ /**
229
+ * Add Custom Fonts to the Elementor Page builder's font param.
230
+ *
231
+ * @param array
232
+ *
233
+ * @since 2.10
234
+ * @return array
235
+ */
236
+ public function add_elementor_fonts( $fonts ) {
237
+
238
+ $all_fonts = $this->get_fonts();
239
+ if ( empty( $all_fonts ) ) {
240
+ return $fonts;
241
+ }
242
+
243
+ foreach ( $all_fonts as $font_family_name ) {
244
+ $fonts[ $font_family_name ] = 'obfx-custom-fonts';
245
+ }
246
+ return $fonts;
247
+ }
248
+
249
+ }
obfx_modules/custom-fonts/init.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The class defines the Custom fonts module.
4
+ *
5
+ * @package Custom_Fonts_OBFX_Module
6
+ * @author Themeisle <friends@themeisle.com>
7
+ * @codeCoverageIgnore
8
+ */
9
+
10
+ // Include custom fonts admin
11
+ require_once OBX_PATH . '/obfx_modules/custom-fonts/custom_fonts_admin.php';
12
+
13
+ // Include custom fonts public
14
+ require_once OBX_PATH . '/obfx_modules/custom-fonts/custom_fonts_public.php';
15
+
16
+
17
+ /**
18
+ * Class Custom_Fonts_OBFX_Module
19
+ */
20
+ class Custom_Fonts_OBFX_Module extends Orbit_Fox_Module_Abstract {
21
+
22
+ /**
23
+ * Menu_Icons_OBFX_Module constructor.
24
+ *
25
+ * @since 2.10
26
+ * @return void
27
+ */
28
+ public function __construct() {
29
+ parent::__construct();
30
+ $this->name = sprintf(
31
+ /* translators: %s is New tag */
32
+ __( 'Custom fonts %s', 'themeisle-companion' ),
33
+ sprintf(
34
+ /* translators: %s is New tag text */
35
+ '<sup class="obfx-title-new">%s</sup>',
36
+ __( 'NEW', 'themeisle-companion' )
37
+ )
38
+ );
39
+ $this->description = __( 'Upload custom fonts and use them anywhere on your site.', 'themeisle-companion' );
40
+ $this->active_default = false;
41
+ }
42
+
43
+ /**
44
+ * Determine if module should be loaded.
45
+ *
46
+ * @since 2.10
47
+ * @return bool
48
+ */
49
+ public function enable_module() {
50
+ return true;
51
+ }
52
+
53
+ /**
54
+ * The loading logic for the module.
55
+ *
56
+ * @since 2.10
57
+ * @return void
58
+ */
59
+ public function load() {
60
+ }
61
+
62
+ /**
63
+ * Method to define hooks needed.
64
+ *
65
+ * @since 2.10
66
+ * @return void
67
+ */
68
+ public function hooks() {
69
+
70
+ $this->loader->add_action( 'admin_enqueue_scripts', $this, 'enqueue_media_scripts' );
71
+
72
+ $admin_instance = new Custom_Fonts_Admin();
73
+ $this->loader->add_action( 'init', $admin_instance, 'create_taxonomy' );
74
+ $this->loader->add_action( 'admin_menu', $admin_instance, 'add_to_menu' );
75
+ $this->loader->add_action( 'admin_head', $admin_instance, 'edit_custom_font_form' );
76
+ $this->loader->add_filter( 'manage_edit-obfx_custom_fonts_columns', $admin_instance, 'manage_columns' );
77
+ $this->loader->add_action( 'obfx_custom_fonts_add_form_fields', $admin_instance, 'add_new_taxonomy_data' );
78
+ $this->loader->add_action( 'obfx_custom_fonts_edit_form_fields', $admin_instance, 'edit_taxonomy_data' );
79
+ $this->loader->add_action( 'edited_obfx_custom_fonts', $admin_instance, 'save_metadata' );
80
+ $this->loader->add_action( 'create_obfx_custom_fonts', $admin_instance, 'save_metadata' );
81
+ $this->loader->add_filter( 'upload_mimes', $admin_instance, 'add_fonts_to_allowed_mimes' );
82
+ $this->loader->add_filter( 'wp_check_filetype_and_ext', $admin_instance, 'update_mime_types', 10, 3 );
83
+
84
+ $public_instance = new Custom_Fonts_Public();
85
+
86
+ // Load the font.
87
+ $this->loader->add_action( 'wp_head', $public_instance, 'add_style' );
88
+ $this->loader->add_action( 'customize_controls_print_styles', $public_instance, 'add_style' );
89
+ if ( is_admin() ) {
90
+ $this->loader->add_action( 'enqueue_block_assets', $public_instance, 'add_style' );
91
+ }
92
+
93
+ // Display the font in customizer in Neve theme
94
+ $this->loader->add_filter( 'neve_react_controls_localization', $public_instance, 'add_custom_fonts' );
95
+
96
+ // Set theme mods to default if font is deleted and was selected in customizer
97
+ $this->loader->add_action( 'delete_term', $public_instance, 'delete_custom_fonts_fallback', 10, 5 );
98
+
99
+ // Beaver Builder theme customizer, Beaver Builder page builder.
100
+ $this->loader->add_filter( 'fl_theme_system_fonts', $public_instance, 'bb_custom_fonts' );
101
+ $this->loader->add_filter( 'fl_builder_font_families_system', $public_instance, 'bb_custom_fonts' );
102
+
103
+ // Add custom fonts in Elementor
104
+ $this->loader->add_filter( 'elementor/fonts/groups', $public_instance, 'elementor_group' );
105
+ $this->loader->add_filter( 'elementor/fonts/additional_fonts', $public_instance, 'add_elementor_fonts' );
106
+
107
+ // Filter that returns the custom fonts list ( can be used at init hook or a hook that is called after init )
108
+ $this->loader->add_filter( 'obfx_get_custom_fonts_list', $public_instance, 'get_fonts' );
109
+ }
110
+
111
+ /**
112
+ * Method to define the options fields for the module
113
+ *
114
+ * @since 2.10
115
+ * @return array
116
+ */
117
+ public function options() {
118
+ return array();
119
+ }
120
+
121
+
122
+ /**
123
+ * Method that returns an array of scripts and styles to be loaded
124
+ * for the admin part.
125
+ *
126
+ * @since 2.10
127
+ * @return array
128
+ */
129
+ public function admin_enqueue() {
130
+ return array(
131
+ 'css' => array( 'admin' => array() ),
132
+ 'js' => array( 'admin' => array( 'jquery' ) ),
133
+ );
134
+ }
135
+
136
+ /**
137
+ * Enqueue media script for the upload button.
138
+ */
139
+ public function enqueue_media_scripts() {
140
+ wp_enqueue_media();
141
+ }
142
+
143
+ /**
144
+ * Method that returns an array of scripts and styles to be loaded
145
+ * for the front end part.
146
+ *
147
+ * @since 2.10
148
+ * @return array
149
+ */
150
+ public function public_enqueue() {
151
+ return array();
152
+ }
153
+
154
+ }
obfx_modules/custom-fonts/js/admin.js ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+
3
+ /**
4
+ * Obfx Custom Fonts
5
+ *
6
+ * @class ObfxCustomFonts
7
+ * @since 1.0.0
8
+ */
9
+
10
+ ObfxCustomFonts = {
11
+
12
+ /**
13
+ * Initializes a Obfx Custom Fonts.
14
+ *
15
+ * @since 1.0
16
+ * @method init
17
+ */
18
+ init: function()
19
+ {
20
+ // Init.
21
+ this._fileUploads();
22
+ },
23
+ /**
24
+ * Font File Uploads
25
+ * parallax.
26
+ *
27
+ * @since 1.0.0
28
+ * @access private
29
+ * @method _fileUploads
30
+ */
31
+ _fileUploads: function()
32
+ {
33
+ var file_frame;
34
+ window.inputWrapper = '';
35
+ $( document.body ).on('click', '.obfx-custom-fonts-upload', function(event) {
36
+ event.preventDefault();
37
+
38
+ window.inputWrapper = $(this).closest('.obfx-custom-fonts-file-wrap');
39
+
40
+ // If the media frame already exists, reopen it.
41
+ if ( file_frame ) {
42
+ file_frame.open();
43
+ return;
44
+ }
45
+
46
+ // Create a new media frame
47
+ file_frame = wp.media.frames.file_frame = wp.media({
48
+ multiple: false // Set to true to allow multiple files to be selected
49
+ });
50
+
51
+ // When an image is selected in the media frame...
52
+ file_frame.on( 'select', function() {
53
+
54
+ // Get media attachment details from the frame state
55
+ var attachment = file_frame.state().get('selection').first().toJSON();
56
+ window.inputWrapper.find( '.obfx-custom-fonts-link' ).val(attachment.url);
57
+ });
58
+ // Finally, open the modal
59
+ file_frame.open();
60
+ });
61
+
62
+ window.inputWrapper = '';
63
+ },
64
+ }
65
+
66
+ /* Initializes the Obfx Custom Fonts. */
67
+ $(function(){
68
+ ObfxCustomFonts.init();
69
+ });
70
+
71
+ })(jQuery);
readme.md CHANGED
@@ -109,6 +109,13 @@ Activating the Orbit Fox plugin is just like any other plugin. If you've uploade
109
 
110
  ## Changelog ##
111
 
 
 
 
 
 
 
 
112
  ##### [Version 2.9.19](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.18...v2.9.19) (2020-09-25)
113
 
114
  * Fix elementor post grid jQuery dependencies
109
 
110
  ## Changelog ##
111
 
112
+ #### [Version 2.10.0](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.19...v2.10.0) (2020-10-09)
113
+
114
+ - New Custom Fonts module
115
+
116
+
117
+
118
+
119
  ##### [Version 2.9.19](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.18...v2.9.19) (2020-09-25)
120
 
121
  * Fix elementor post grid jQuery dependencies
readme.txt CHANGED
@@ -109,6 +109,13 @@ Activating the Orbit Fox plugin is just like any other plugin. If you've uploade
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
112
  ##### [Version 2.9.19](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.18...v2.9.19) (2020-09-25)
113
 
114
  * Fix elementor post grid jQuery dependencies
109
 
110
  == Changelog ==
111
 
112
+ #### [Version 2.10.0](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.19...v2.10.0) (2020-10-09)
113
+
114
+ - New Custom Fonts module
115
+
116
+
117
+
118
+
119
  ##### [Version 2.9.19](https://github.com/Codeinwp/themeisle-companion/compare/v2.9.18...v2.9.19) (2020-09-25)
120
 
121
  * Fix elementor post grid jQuery dependencies
themeisle-companion.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Orbit Fox Companion
16
  * Plugin URI: https://orbitfox.com/
17
  * Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, Gutenberg blocks, and newly added Elementor/BeaverBuilder page builder widgets on each release.
18
- * Version: 2.9.19
19
  * Author: Themeisle
20
  * Author URI: https://orbitfox.com/
21
  * License: GPL-2.0+
15
  * Plugin Name: Orbit Fox Companion
16
  * Plugin URI: https://orbitfox.com/
17
  * Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, Gutenberg blocks, and newly added Elementor/BeaverBuilder page builder widgets on each release.
18
+ * Version: 2.10.0
19
  * Author: Themeisle
20
  * Author URI: https://orbitfox.com/
21
  * License: GPL-2.0+
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitbb1a79a4d05fe887c823fb7fce639c4c::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit66e4adc309d0c4c6bf763eebd4bb9918::getLoader();
vendor/clue/stream-filter/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
  # Changelog
2
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ## 1.4.1 (2019-04-09)
4
 
5
  * Fix: Check if the function is declared before declaring it.
1
  # Changelog
2
 
3
+ ## 1.5.0 (2020-10-02)
4
+
5
+ * Feature: Improve performance by using global imports.
6
+ (#38 by @clue)
7
+
8
+ * Improve API documentation and add support / sponsorship info.
9
+ (#30 by @clue and #35 by @SimonFrings)
10
+
11
+ * Improve test suite and add `.gitattributes` to exclude dev files from exports.
12
+ Prepare PHP 8 support, update to PHPUnit 9 and simplify test matrix.
13
+ (#32 and #37 by @clue and #34 and #36 by @SimonFrings)
14
+
15
  ## 1.4.1 (2019-04-09)
16
 
17
  * Fix: Check if the function is declared before declaring it.
vendor/clue/stream-filter/README.md CHANGED
@@ -5,6 +5,7 @@ A simple and modern approach to stream filtering in PHP
5
  **Table of contents**
6
 
7
  * [Why?](#why)
 
8
  * [Usage](#usage)
9
  * [append()](#append)
10
  * [prepend()](#prepend)
@@ -39,6 +40,16 @@ This project aims to make these features more accessible to a broader audience.
39
  * **Good test coverage** -
40
  Comes with an automated tests suite and is regularly tested in the *real world*
41
 
 
 
 
 
 
 
 
 
 
 
42
  ## Usage
43
 
44
  This lightweight library consists only of a few simple functions.
@@ -58,15 +69,22 @@ Alternatively, you can also refer to them with their fully-qualified name:
58
  \Clue\StreamFilter\append(…);
59
  ```
60
 
 
 
 
 
 
 
 
 
61
  ### append()
62
 
63
- The `append($stream, $callback, $read_write = STREAM_FILTER_ALL)` function can be used to
64
  append a filter callback to the given stream.
65
 
66
  Each stream can have a list of filters attached.
67
  This function appends a filter to the end of this list.
68
 
69
- This function returns a filter resource which can be passed to [`remove()`](#remove).
70
  If the given filter can not be added, it throws an `Exception`.
71
 
72
  The `$stream` can be any valid stream resource, such as:
@@ -75,8 +93,8 @@ The `$stream` can be any valid stream resource, such as:
75
  $stream = fopen('demo.txt', 'w+');
76
  ```
77
 
78
- The `$callback` should be a valid callable function which accepts an individual chunk of data
79
- and should return the updated chunk:
80
 
81
  ```php
82
  $filter = Filter\append($stream, function ($chunk) {
@@ -94,8 +112,8 @@ Filter\append($stream, 'strtoupper');
94
  fwrite($stream, 'hello');
95
  ```
96
 
97
- If the `$callback` accepts invocation without parameters, then this signature
98
- will be invoked once ending (flushing) the filter:
99
 
100
  ```php
101
  Filter\append($stream, function ($chunk = null) {
@@ -114,8 +132,8 @@ fclose($stream);
114
  from the end signal handler if the stream is being closed.
115
 
116
  If your callback throws an `Exception`, then the filter process will be aborted.
117
- In order to play nice with PHP's stream handling, the `Exception` will be
118
- transformed to a PHP warning instead:
119
 
120
  ```php
121
  Filter\append($stream, function ($chunk) {
@@ -126,7 +144,8 @@ Filter\append($stream, function ($chunk) {
126
  fwrite($stream, 'hello');
127
  ```
128
 
129
- The optional `$read_write` parameter can be used to only invoke the `$callback` when either writing to the stream or only when reading from the stream:
 
130
 
131
  ```php
132
  Filter\append($stream, function ($chunk) {
@@ -140,6 +159,8 @@ Filter\append($stream, function ($chunk) {
140
  }, STREAM_FILTER_READ);
141
  ```
142
 
 
 
143
  > Note that once a filter has been added to stream, the stream can no longer be passed to
144
  > [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php)
145
  > (and family).
@@ -153,13 +174,12 @@ Filter\append($stream, function ($chunk) {
153
 
154
  ### prepend()
155
 
156
- The `prepend($stream, $callback, $read_write = STREAM_FILTER_ALL)` function can be used to
157
  prepend a filter callback to the given stream.
158
 
159
  Each stream can have a list of filters attached.
160
  This function prepends a filter to the start of this list.
161
 
162
- This function returns a filter resource which can be passed to [`remove()`](#remove).
163
  If the given filter can not be added, it throws an `Exception`.
164
 
165
  ```php
@@ -169,13 +189,15 @@ $filter = Filter\prepend($stream, function ($chunk) {
169
  });
170
  ```
171
 
 
 
172
  Except for the position in the list of filters, this function behaves exactly
173
  like the [`append()`](#append) function.
174
  For more details about its behavior, see also the [`append()`](#append) function.
175
 
176
  ### fun()
177
 
178
- The `fun($filter, $parameters = null)` function can be used to
179
  create a filter function which uses the given built-in `$filter`.
180
 
181
  PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php).
@@ -189,8 +211,8 @@ assert('grfg' === $fun('test'));
189
  assert('test' === $fun($fun('test'));
190
  ```
191
 
192
- Please note that not all filter functions may be available depending on installed
193
- PHP extensions and the PHP version in use.
194
  In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions
195
  or parameters as Zend PHP.
196
  Accessing an unknown filter function will result in a `RuntimeException`:
@@ -248,7 +270,7 @@ If you feel some test case is missing or outdated, we're happy to accept PRs! :)
248
 
249
  ### remove()
250
 
251
- The `remove($filter)` function can be used to
252
  remove a filter previously added via [`append()`](#append) or [`prepend()`](#prepend).
253
 
254
  ```php
@@ -267,7 +289,7 @@ This project follows [SemVer](https://semver.org/).
267
  This will install the latest supported version:
268
 
269
  ```bash
270
- $ composer require clue/stream-filter:^1.4.1
271
  ```
272
 
273
  See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
5
  **Table of contents**
6
 
7
  * [Why?](#why)
8
+ * [Support us](#support-us)
9
  * [Usage](#usage)
10
  * [append()](#append)
11
  * [prepend()](#prepend)
40
  * **Good test coverage** -
41
  Comes with an automated tests suite and is regularly tested in the *real world*
42
 
43
+ ## Support us
44
+
45
+ We invest a lot of time developing, maintaining and updating our awesome
46
+ open-source projects. You can help us sustain this high-quality of our work by
47
+ [becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get
48
+ numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue)
49
+ for details.
50
+
51
+ Let's take these projects to the next level together! 🚀
52
+
53
  ## Usage
54
 
55
  This lightweight library consists only of a few simple functions.
69
  \Clue\StreamFilter\append(…);
70
  ```
71
 
72
+ As of PHP 5.6+ you can also import each required function into your code like this:
73
+
74
+ ```php
75
+ use function Clue\StreamFilter\append;
76
+
77
+ append(…);
78
+ ```
79
+
80
  ### append()
81
 
82
+ The `append(resource<stream> $stream, callable $callback, int $read_write = STREAM_FILTER_ALL): resource<stream filter>` function can be used to
83
  append a filter callback to the given stream.
84
 
85
  Each stream can have a list of filters attached.
86
  This function appends a filter to the end of this list.
87
 
 
88
  If the given filter can not be added, it throws an `Exception`.
89
 
90
  The `$stream` can be any valid stream resource, such as:
93
  $stream = fopen('demo.txt', 'w+');
94
  ```
95
 
96
+ The `$callback` should be a valid callable function which accepts
97
+ an individual chunk of data and should return the updated chunk:
98
 
99
  ```php
100
  $filter = Filter\append($stream, function ($chunk) {
112
  fwrite($stream, 'hello');
113
  ```
114
 
115
+ If the `$callback` accepts invocation without parameters,
116
+ then this signature will be invoked once ending (flushing) the filter:
117
 
118
  ```php
119
  Filter\append($stream, function ($chunk = null) {
132
  from the end signal handler if the stream is being closed.
133
 
134
  If your callback throws an `Exception`, then the filter process will be aborted.
135
+ In order to play nice with PHP's stream handling,
136
+ the `Exception` will be transformed to a PHP warning instead:
137
 
138
  ```php
139
  Filter\append($stream, function ($chunk) {
144
  fwrite($stream, 'hello');
145
  ```
146
 
147
+ The optional `$read_write` parameter can be used to only invoke the `$callback`
148
+ when either writing to the stream or only when reading from the stream:
149
 
150
  ```php
151
  Filter\append($stream, function ($chunk) {
159
  }, STREAM_FILTER_READ);
160
  ```
161
 
162
+ This function returns a filter resource which can be passed to [`remove()`](#remove).
163
+
164
  > Note that once a filter has been added to stream, the stream can no longer be passed to
165
  > [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php)
166
  > (and family).
174
 
175
  ### prepend()
176
 
177
+ The `prepend(resource<stream> $stream, callable $callback, int $read_write = STREAM_FILTER_ALL): resource<stream filter>` function can be used to
178
  prepend a filter callback to the given stream.
179
 
180
  Each stream can have a list of filters attached.
181
  This function prepends a filter to the start of this list.
182
 
 
183
  If the given filter can not be added, it throws an `Exception`.
184
 
185
  ```php
189
  });
190
  ```
191
 
192
+ This function returns a filter resource which can be passed to [`remove()`](#remove).
193
+
194
  Except for the position in the list of filters, this function behaves exactly
195
  like the [`append()`](#append) function.
196
  For more details about its behavior, see also the [`append()`](#append) function.
197
 
198
  ### fun()
199
 
200
+ The `fun(string $filter, mixed $parameters = null): callable` function can be used to
201
  create a filter function which uses the given built-in `$filter`.
202
 
203
  PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php).
211
  assert('test' === $fun($fun('test'));
212
  ```
213
 
214
+ Please note that not all filter functions may be available depending
215
+ on installed PHP extensions and the PHP version in use.
216
  In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions
217
  or parameters as Zend PHP.
218
  Accessing an unknown filter function will result in a `RuntimeException`:
270
 
271
  ### remove()
272
 
273
+ The `remove(resource<stream filter> $filter): bool` function can be used to
274
  remove a filter previously added via [`append()`](#append) or [`prepend()`](#prepend).
275
 
276
  ```php
289
  This will install the latest supported version:
290
 
291
  ```bash
292
+ $ composer require clue/stream-filter:^1.5
293
  ```
294
 
295
  See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
vendor/clue/stream-filter/examples/base64_decode.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
-
3
- // $ echo test | php examples/base64_encode.php | php examples/base64_decode.php
4
-
5
- require __DIR__ . '/../vendor/autoload.php';
6
-
7
- // decoding requires buffering in chunks of 4 bytes each
8
- $buffer = '';
9
- Clue\StreamFilter\append(STDIN, function ($chunk = null) use (&$buffer) {
10
- if ($chunk === null) {
11
- if (strlen($buffer) % 4 !== 0) {
12
- throw new \UnexpectedValueException('Invalid length');
13
- }
14
- $chunk = $buffer;
15
- } else {
16
- $buffer .= $chunk;
17
- $len = strlen($buffer) - (strlen($buffer) % 4);
18
- $chunk = (string)substr($buffer, 0, $len);
19
- $buffer = (string)substr($buffer, $len);
20
- }
21
-
22
- $ret = base64_decode($chunk, true);
23
- if ($ret === false) {
24
- throw new \UnexpectedValueException('Not a valid base64 encoded chunk');
25
- }
26
- return $ret;
27
- }, STREAM_FILTER_READ);
28
-
29
- fpassthru(STDIN);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/clue/stream-filter/examples/base64_encode.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- // $ echo test | php examples/base64_encode.php | base64 --decode
4
-
5
- require __DIR__ . '/../vendor/autoload.php';
6
-
7
- // encoding requires buffering in chunks of 3 bytes each
8
- $buffer = '';
9
- Clue\StreamFilter\append(STDIN, function ($chunk = null) use (&$buffer) {
10
- if ($chunk === null) {
11
- return base64_encode($buffer);
12
- }
13
- $buffer .= $chunk;
14
- $len = strlen($buffer) - (strlen($buffer) % 3);
15
- $chunk = substr($buffer, 0, $len);
16
- $buffer = substr($buffer, $len);
17
-
18
- return base64_encode($chunk);
19
- }, STREAM_FILTER_READ);
20
-
21
- fpassthru(STDIN);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/clue/stream-filter/examples/uppercase.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- // $ echo test | php examples/uppercase.php
4
-
5
- require __DIR__ . '/../vendor/autoload.php';
6
-
7
- Clue\StreamFilter\append(STDIN, 'strtoupper');
8
-
9
- fpassthru(STDIN);
 
 
 
 
 
 
 
 
 
vendor/clue/stream-filter/phpunit.xml.dist DELETED
@@ -1,19 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <phpunit bootstrap="vendor/autoload.php"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite>
11
- <directory>./tests/</directory>
12
- </testsuite>
13
- </testsuites>
14
- <filter>
15
- <whitelist>
16
- <directory>./src/</directory>
17
- </whitelist>
18
- </filter>
19
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/clue/stream-filter/src/CallbackFilter.php CHANGED
@@ -2,18 +2,12 @@
2
 
3
  namespace Clue\StreamFilter;
4
 
5
- use php_user_filter;
6
- use InvalidArgumentException;
7
- use ReflectionFunction;
8
- use Exception;
9
-
10
  /**
11
- *
12
  * @internal
13
  * @see append()
14
  * @see prepend()
15
  */
16
- class CallbackFilter extends php_user_filter
17
  {
18
  private $callback;
19
  private $closed = true;
@@ -23,13 +17,13 @@ class CallbackFilter extends php_user_filter
23
  {
24
  $this->closed = false;
25
 
26
- if (!is_callable($this->params)) {
27
- throw new InvalidArgumentException('No valid callback parameter given to stream_filter_(append|prepend)');
28
  }
29
  $this->callback = $this->params;
30
 
31
  // callback supports end event if it accepts invocation without arguments
32
- $ref = new ReflectionFunction($this->callback);
33
  $this->supportsClose = ($ref->getNumberOfRequiredParameters() === 0);
34
 
35
  return true;
@@ -44,8 +38,8 @@ class CallbackFilter extends php_user_filter
44
  $this->supportsClose = false;
45
  // invoke without argument to signal end and discard resulting buffer
46
  try {
47
- call_user_func($this->callback);
48
- } catch (Exception $ignored) {
49
  // this might be called during engine shutdown, so it's not safe
50
  // to raise any errors or exceptions here
51
  // trigger_error('Error closing filter: ' . $ignored->getMessage(), E_USER_WARNING);
@@ -59,27 +53,27 @@ class CallbackFilter extends php_user_filter
59
  {
60
  // concatenate whole buffer from input brigade
61
  $data = '';
62
- while ($bucket = stream_bucket_make_writeable($in)) {
63
  $consumed += $bucket->datalen;
64
  $data .= $bucket->data;
65
  }
66
 
67
  // skip processing callback that already ended
68
  if ($this->closed) {
69
- return PSFS_FEED_ME;
70
  }
71
 
72
  // only invoke filter function if buffer is not empty
73
  // this may skip flushing a closing filter
74
  if ($data !== '') {
75
  try {
76
- $data = call_user_func($this->callback, $data);
77
- } catch (Exception $e) {
78
  // exception should mark filter as closed
79
  $this->onClose();
80
- trigger_error('Error invoking filter: ' . $e->getMessage(), E_USER_WARNING);
81
 
82
- return PSFS_ERR_FATAL;
83
  }
84
  }
85
 
@@ -93,11 +87,11 @@ class CallbackFilter extends php_user_filter
93
 
94
  // invoke without argument to signal end and append resulting buffer
95
  try {
96
- $data .= call_user_func($this->callback);
97
- } catch (Exception $e) {
98
- trigger_error('Error ending filter: ' . $e->getMessage(), E_USER_WARNING);
99
 
100
- return PSFS_ERR_FATAL;
101
  }
102
  }
103
  }
@@ -105,16 +99,16 @@ class CallbackFilter extends php_user_filter
105
  if ($data !== '') {
106
  // create a new bucket for writing the resulting buffer to the output brigade
107
  // reusing an existing bucket turned out to be bugged in some environments (ancient PHP versions and HHVM)
108
- $bucket = @stream_bucket_new($this->stream, $data);
109
 
110
  // legacy PHP versions (PHP < 5.4) do not support passing data from the event signal handler
111
  // because closing the stream invalidates the stream and its stream bucket brigade before
112
  // invoking the filter close handler.
113
  if ($bucket !== false) {
114
- stream_bucket_append($out, $bucket);
115
  }
116
  }
117
 
118
- return PSFS_PASS_ON;
119
  }
120
  }
2
 
3
  namespace Clue\StreamFilter;
4
 
 
 
 
 
 
5
  /**
 
6
  * @internal
7
  * @see append()
8
  * @see prepend()
9
  */
10
+ class CallbackFilter extends \php_user_filter
11
  {
12
  private $callback;
13
  private $closed = true;
17
  {
18
  $this->closed = false;
19
 
20
+ if (!\is_callable($this->params)) {
21
+ throw new \InvalidArgumentException('No valid callback parameter given to stream_filter_(append|prepend)');
22
  }
23
  $this->callback = $this->params;
24
 
25
  // callback supports end event if it accepts invocation without arguments
26
+ $ref = new \ReflectionFunction($this->callback);
27
  $this->supportsClose = ($ref->getNumberOfRequiredParameters() === 0);
28
 
29
  return true;
38
  $this->supportsClose = false;
39
  // invoke without argument to signal end and discard resulting buffer
40
  try {
41
+ \call_user_func($this->callback);
42
+ } catch (\Exception $ignored) {
43
  // this might be called during engine shutdown, so it's not safe
44
  // to raise any errors or exceptions here
45
  // trigger_error('Error closing filter: ' . $ignored->getMessage(), E_USER_WARNING);
53
  {
54
  // concatenate whole buffer from input brigade
55
  $data = '';
56
+ while ($bucket = \stream_bucket_make_writeable($in)) {
57
  $consumed += $bucket->datalen;
58
  $data .= $bucket->data;
59
  }
60
 
61
  // skip processing callback that already ended
62
  if ($this->closed) {
63
+ return \PSFS_FEED_ME;
64
  }
65
 
66
  // only invoke filter function if buffer is not empty
67
  // this may skip flushing a closing filter
68
  if ($data !== '') {
69
  try {
70
+ $data = \call_user_func($this->callback, $data);
71
+ } catch (\Exception $e) {
72
  // exception should mark filter as closed
73
  $this->onClose();
74
+ \trigger_error('Error invoking filter: ' . $e->getMessage(), \E_USER_WARNING);
75
 
76
+ return \PSFS_ERR_FATAL;
77
  }
78
  }
79
 
87
 
88
  // invoke without argument to signal end and append resulting buffer
89
  try {
90
+ $data .= \call_user_func($this->callback);
91
+ } catch (\Exception $e) {
92
+ \trigger_error('Error ending filter: ' . $e->getMessage(), \E_USER_WARNING);
93
 
94
+ return \PSFS_ERR_FATAL;
95
  }
96
  }
97
  }
99
  if ($data !== '') {
100
  // create a new bucket for writing the resulting buffer to the output brigade
101
  // reusing an existing bucket turned out to be bugged in some environments (ancient PHP versions and HHVM)
102
+ $bucket = @\stream_bucket_new($this->stream, $data);
103
 
104
  // legacy PHP versions (PHP < 5.4) do not support passing data from the event signal handler
105
  // because closing the stream invalidates the stream and its stream bucket brigade before
106
  // invoking the filter close handler.
107
  if ($bucket !== false) {
108
+ \stream_bucket_append($out, $bucket);
109
  }
110
  }
111
 
112
+ return \PSFS_PASS_ON;
113
  }
114
  }
vendor/clue/stream-filter/src/functions.php CHANGED
@@ -2,54 +2,187 @@
2
 
3
  namespace Clue\StreamFilter;
4
 
5
- use RuntimeException;
6
-
7
  /**
8
- * append a callback filter to the given stream
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  *
10
  * @param resource $stream
11
  * @param callable $callback
12
  * @param int $read_write
13
  * @return resource filter resource which can be used for `remove()`
14
- * @throws Exception on error
15
  * @uses stream_filter_append()
16
  */
17
  function append($stream, $callback, $read_write = STREAM_FILTER_ALL)
18
  {
19
- $ret = @stream_filter_append($stream, register(), $read_write, $callback);
20
 
 
 
21
  if ($ret === false) {
22
- $error = error_get_last() + array('message' => '');
23
- throw new RuntimeException('Unable to append filter: ' . $error['message']);
24
  }
 
25
 
26
  return $ret;
27
  }
28
 
29
  /**
30
- * prepend a callback filter to the given stream
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  *
32
  * @param resource $stream
33
  * @param callable $callback
34
  * @param int $read_write
35
  * @return resource filter resource which can be used for `remove()`
36
- * @throws Exception on error
37
  * @uses stream_filter_prepend()
38
  */
39
  function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL)
40
  {
41
- $ret = @stream_filter_prepend($stream, register(), $read_write, $callback);
42
 
 
 
43
  if ($ret === false) {
44
- $error = error_get_last() + array('message' => '');
45
- throw new RuntimeException('Unable to prepend filter: ' . $error['message']);
46
  }
 
47
 
48
  return $ret;
49
  }
50
 
51
  /**
52
- * Creates filter fun (function) which uses the given built-in $filter
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  *
54
  * Some filters may accept or require additional filter parameters – most
55
  * filters do not require filter parameters.
@@ -58,28 +191,67 @@ function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL)
58
  * In particular, note how *not passing* this parameter at all differs from
59
  * explicitly passing a `null` value (which many filters do not accept).
60
  * Please refer to the individual filter definition for more details.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  *
62
  * @param string $filter built-in filter name. See stream_get_filters() or http://php.net/manual/en/filters.php
63
  * @param mixed $parameters (optional) parameters to pass to the built-in filter as-is
64
  * @return callable a filter callback which can be append()'ed or prepend()'ed
65
- * @throws RuntimeException on error
66
  * @link http://php.net/manual/en/filters.php
67
  * @see stream_get_filters()
68
  * @see append()
69
  */
70
  function fun($filter, $parameters = null)
71
  {
72
- $fp = fopen('php://memory', 'w');
73
- if (func_num_args() === 1) {
74
- $filter = @stream_filter_append($fp, $filter, STREAM_FILTER_WRITE);
75
  } else {
76
- $filter = @stream_filter_append($fp, $filter, STREAM_FILTER_WRITE, $parameters);
77
  }
78
 
79
  if ($filter === false) {
80
- fclose($fp);
81
- $error = error_get_last() + array('message' => '');
82
- throw new RuntimeException('Unable to access built-in filter: ' . $error['message']);
83
  }
84
 
85
  // append filter function which buffers internally
@@ -89,7 +261,7 @@ function fun($filter, $parameters = null)
89
 
90
  // always return empty string in order to skip actually writing to stream resource
91
  return '';
92
- }, STREAM_FILTER_WRITE);
93
 
94
  $closed = false;
95
 
@@ -100,12 +272,12 @@ function fun($filter, $parameters = null)
100
  if ($chunk === null) {
101
  $closed = true;
102
  $buffer = '';
103
- fclose($fp);
104
  return $buffer;
105
  }
106
  // initialize buffer and invoke filters by attempting to write to stream
107
  $buffer = '';
108
- fwrite($fp, $chunk);
109
 
110
  // buffer now contains everything the filter function returned
111
  return $buffer;
@@ -113,22 +285,31 @@ function fun($filter, $parameters = null)
113
  }
114
 
115
  /**
116
- * remove a callback filter from the given stream
 
 
 
 
 
 
 
117
  *
118
  * @param resource $filter
119
- * @return boolean true on success or false on error
120
- * @throws Exception on error
121
  * @uses stream_filter_remove()
122
  */
123
  function remove($filter)
124
  {
125
- if (@stream_filter_remove($filter) === false) {
126
- throw new RuntimeException('Unable to remove given filter');
 
 
127
  }
128
  }
129
 
130
  /**
131
- * registers the callback filter and returns the resulting filter name
132
  *
133
  * There should be little reason to call this function manually.
134
  *
@@ -140,7 +321,7 @@ function register()
140
  static $registered = null;
141
  if ($registered === null) {
142
  $registered = 'stream-callback';
143
- stream_filter_register($registered, __NAMESPACE__ . '\CallbackFilter');
144
  }
145
  return $registered;
146
  }
2
 
3
  namespace Clue\StreamFilter;
4
 
 
 
5
  /**
6
+ * Append a filter callback to the given stream.
7
+ *
8
+ * Each stream can have a list of filters attached.
9
+ * This function appends a filter to the end of this list.
10
+ *
11
+ * If the given filter can not be added, it throws an `Exception`.
12
+ *
13
+ * The `$stream` can be any valid stream resource, such as:
14
+ *
15
+ * ```php
16
+ * $stream = fopen('demo.txt', 'w+');
17
+ * ```
18
+ *
19
+ * The `$callback` should be a valid callable function which accepts
20
+ * an individual chunk of data and should return the updated chunk:
21
+ *
22
+ * ```php
23
+ * $filter = Filter\append($stream, function ($chunk) {
24
+ * // will be called each time you read or write a $chunk to/from the stream
25
+ * return $chunk;
26
+ * });
27
+ * ```
28
+ *
29
+ * As such, you can also use native PHP functions or any other `callable`:
30
+ *
31
+ * ```php
32
+ * Filter\append($stream, 'strtoupper');
33
+ *
34
+ * // will write "HELLO" to the underlying stream
35
+ * fwrite($stream, 'hello');
36
+ * ```
37
+ *
38
+ * If the `$callback` accepts invocation without parameters,
39
+ * then this signature will be invoked once ending (flushing) the filter:
40
+ *
41
+ * ```php
42
+ * Filter\append($stream, function ($chunk = null) {
43
+ * if ($chunk === null) {
44
+ * // will be called once ending the filter
45
+ * return 'end';
46
+ * }
47
+ * // will be called each time you read or write a $chunk to/from the stream
48
+ * return $chunk;
49
+ * });
50
+ *
51
+ * fclose($stream);
52
+ * ```
53
+ *
54
+ * > Note: Legacy PHP versions (PHP < 5.4) do not support passing additional data
55
+ * from the end signal handler if the stream is being closed.
56
+ *
57
+ * If your callback throws an `Exception`, then the filter process will be aborted.
58
+ * In order to play nice with PHP's stream handling,
59
+ * the `Exception` will be transformed to a PHP warning instead:
60
+ *
61
+ * ```php
62
+ * Filter\append($stream, function ($chunk) {
63
+ * throw new \RuntimeException('Unexpected chunk');
64
+ * });
65
+ *
66
+ * // raises an E_USER_WARNING with "Error invoking filter: Unexpected chunk"
67
+ * fwrite($stream, 'hello');
68
+ * ```
69
+ *
70
+ * The optional `$read_write` parameter can be used to only invoke the `$callback`
71
+ * when either writing to the stream or only when reading from the stream:
72
+ *
73
+ * ```php
74
+ * Filter\append($stream, function ($chunk) {
75
+ * // will be called each time you write to the stream
76
+ * return $chunk;
77
+ * }, STREAM_FILTER_WRITE);
78
+ *
79
+ * Filter\append($stream, function ($chunk) {
80
+ * // will be called each time you read from the stream
81
+ * return $chunk;
82
+ * }, STREAM_FILTER_READ);
83
+ * ```
84
+ *
85
+ * This function returns a filter resource which can be passed to [`remove()`](#remove).
86
+ *
87
+ * > Note that once a filter has been added to stream, the stream can no longer be passed to
88
+ * > [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php)
89
+ * > (and family).
90
+ * >
91
+ * > > Warning: stream_select(): cannot cast a filtered stream on this system in {file} on line {line}
92
+ * >
93
+ * > This is due to limitations of PHP's stream filter support, as it can no longer reliably
94
+ * > tell when the underlying stream resource is actually ready.
95
+ * > As an alternative, consider calling `stream_select()` on the unfiltered stream and
96
+ * > then pass the unfiltered data through the [`fun()`](#fun) function.
97
  *
98
  * @param resource $stream
99
  * @param callable $callback
100
  * @param int $read_write
101
  * @return resource filter resource which can be used for `remove()`
102
+ * @throws \Exception on error
103
  * @uses stream_filter_append()
104
  */
105
  function append($stream, $callback, $read_write = STREAM_FILTER_ALL)
106
  {
107
+ $ret = @\stream_filter_append($stream, register(), $read_write, $callback);
108
 
109
+ // PHP 8 throws above on type errors, older PHP and memory issues can throw here
110
+ // @codeCoverageIgnoreStart
111
  if ($ret === false) {
112
+ $error = \error_get_last() + array('message' => '');
113
+ throw new \RuntimeException('Unable to append filter: ' . $error['message']);
114
  }
115
+ // @codeCoverageIgnoreEnd
116
 
117
  return $ret;
118
  }
119
 
120
  /**
121
+ * Prepend a filter callback to the given stream.
122
+ *
123
+ * Each stream can have a list of filters attached.
124
+ * This function prepends a filter to the start of this list.
125
+ *
126
+ * If the given filter can not be added, it throws an `Exception`.
127
+ *
128
+ * ```php
129
+ * $filter = Filter\prepend($stream, function ($chunk) {
130
+ * // will be called each time you read or write a $chunk to/from the stream
131
+ * return $chunk;
132
+ * });
133
+ * ```
134
+ *
135
+ * This function returns a filter resource which can be passed to [`remove()`](#remove).
136
+ *
137
+ * Except for the position in the list of filters, this function behaves exactly
138
+ * like the [`append()`](#append) function.
139
+ * For more details about its behavior, see also the [`append()`](#append) function.
140
  *
141
  * @param resource $stream
142
  * @param callable $callback
143
  * @param int $read_write
144
  * @return resource filter resource which can be used for `remove()`
145
+ * @throws \Exception on error
146
  * @uses stream_filter_prepend()
147
  */
148
  function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL)
149
  {
150
+ $ret = @\stream_filter_prepend($stream, register(), $read_write, $callback);
151
 
152
+ // PHP 8 throws above on type errors, older PHP and memory issues can throw here
153
+ // @codeCoverageIgnoreStart
154
  if ($ret === false) {
155
+ $error = \error_get_last() + array('message' => '');
156
+ throw new \RuntimeException('Unable to prepend filter: ' . $error['message']);
157
  }
158
+ // @codeCoverageIgnoreEnd
159
 
160
  return $ret;
161
  }
162
 
163
  /**
164
+ * Create a filter function which uses the given built-in `$filter`.
165
+ *
166
+ * PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php).
167
+ * Using `fun()` makes accessing these as easy as passing an input string to filter
168
+ * and getting the filtered output string.
169
+ *
170
+ * ```php
171
+ * $fun = Filter\fun('string.rot13');
172
+ *
173
+ * assert('grfg' === $fun('test'));
174
+ * assert('test' === $fun($fun('test'));
175
+ * ```
176
+ *
177
+ * Please note that not all filter functions may be available depending
178
+ * on installed PHP extensions and the PHP version in use.
179
+ * In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions
180
+ * or parameters as Zend PHP.
181
+ * Accessing an unknown filter function will result in a `RuntimeException`:
182
+ *
183
+ * ```php
184
+ * Filter\fun('unknown'); // throws RuntimeException
185
+ * ```
186
  *
187
  * Some filters may accept or require additional filter parameters – most
188
  * filters do not require filter parameters.
191
  * In particular, note how *not passing* this parameter at all differs from
192
  * explicitly passing a `null` value (which many filters do not accept).
193
  * Please refer to the individual filter definition for more details.
194
+ * For example, the `string.strip_tags` filter can be invoked like this:
195
+ *
196
+ * ```php
197
+ * $fun = Filter\fun('string.strip_tags', '<a><b>');
198
+ *
199
+ * $ret = $fun('<b>h<br>i</b>');
200
+ * assert('<b>hi</b>' === $ret);
201
+ * ```
202
+ *
203
+ * Under the hood, this function allocates a temporary memory stream, so it's
204
+ * recommended to clean up the filter function after use.
205
+ * Also, some filter functions (in particular the
206
+ * [zlib compression filters](https://www.php.net/manual/en/filters.compression.php))
207
+ * may use internal buffers and may emit a final data chunk on close.
208
+ * The filter function can be closed by invoking without any arguments:
209
+ *
210
+ * ```php
211
+ * $fun = Filter\fun('zlib.deflate');
212
+ *
213
+ * $ret = $fun('hello') . $fun('world') . $fun();
214
+ * assert('helloworld' === gzinflate($ret));
215
+ * ```
216
+ *
217
+ * The filter function must not be used anymore after it has been closed.
218
+ * Doing so will result in a `RuntimeException`:
219
+ *
220
+ * ```php
221
+ * $fun = Filter\fun('string.rot13');
222
+ * $fun();
223
+ *
224
+ * $fun('test'); // throws RuntimeException
225
+ * ```
226
+ *
227
+ * > Note: If you're using the zlib compression filters, then you should be wary
228
+ * about engine inconsistencies between different PHP versions and HHVM.
229
+ * These inconsistencies exist in the underlying PHP engines and there's little we
230
+ * can do about this in this library.
231
+ * [Our test suite](tests/) contains several test cases that exhibit these issues.
232
+ * If you feel some test case is missing or outdated, we're happy to accept PRs! :)
233
  *
234
  * @param string $filter built-in filter name. See stream_get_filters() or http://php.net/manual/en/filters.php
235
  * @param mixed $parameters (optional) parameters to pass to the built-in filter as-is
236
  * @return callable a filter callback which can be append()'ed or prepend()'ed
237
+ * @throws \RuntimeException on error
238
  * @link http://php.net/manual/en/filters.php
239
  * @see stream_get_filters()
240
  * @see append()
241
  */
242
  function fun($filter, $parameters = null)
243
  {
244
+ $fp = \fopen('php://memory', 'w');
245
+ if (\func_num_args() === 1) {
246
+ $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE);
247
  } else {
248
+ $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE, $parameters);
249
  }
250
 
251
  if ($filter === false) {
252
+ \fclose($fp);
253
+ $error = \error_get_last() + array('message' => '');
254
+ throw new \RuntimeException('Unable to access built-in filter: ' . $error['message']);
255
  }
256
 
257
  // append filter function which buffers internally
261
 
262
  // always return empty string in order to skip actually writing to stream resource
263
  return '';
264
+ }, \STREAM_FILTER_WRITE);
265
 
266
  $closed = false;
267
 
272
  if ($chunk === null) {
273
  $closed = true;
274
  $buffer = '';
275
+ \fclose($fp);
276
  return $buffer;
277
  }
278
  // initialize buffer and invoke filters by attempting to write to stream
279
  $buffer = '';
280
+ \fwrite($fp, $chunk);
281
 
282
  // buffer now contains everything the filter function returned
283
  return $buffer;
285
  }
286
 
287
  /**
288
+ * Remove a filter previously added via `append()` or `prepend()`.
289
+ *
290
+ * ```php
291
+ * $filter = Filter\append($stream, function () {
292
+ * // …
293
+ * });
294
+ * Filter\remove($filter);
295
+ * ```
296
  *
297
  * @param resource $filter
298
+ * @return bool true on success or false on error
299
+ * @throws \RuntimeException on error
300
  * @uses stream_filter_remove()
301
  */
302
  function remove($filter)
303
  {
304
+ if (@\stream_filter_remove($filter) === false) {
305
+ // PHP 8 throws above on type errors, older PHP and memory issues can throw here
306
+ $error = \error_get_last();
307
+ throw new \RuntimeException('Unable to remove filter: ' . $error['message']);
308
  }
309
  }
310
 
311
  /**
312
+ * Registers the callback filter and returns the resulting filter name
313
  *
314
  * There should be little reason to call this function manually.
315
  *
321
  static $registered = null;
322
  if ($registered === null) {
323
  $registered = 'stream-callback';
324
+ \stream_filter_register($registered, __NAMESPACE__ . '\CallbackFilter');
325
  }
326
  return $registered;
327
  }
vendor/clue/stream-filter/src/functions_include.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
 
3
- if (!function_exists('Clue\\StreamFilter\\append')) {
 
4
  require __DIR__ . '/functions.php';
5
  }
1
  <?php
2
 
3
+ // @codeCoverageIgnoreStart
4
+ if (!\function_exists('Clue\\StreamFilter\\append')) {
5
  require __DIR__ . '/functions.php';
6
  }
vendor/composer/autoload_classmap.php CHANGED
@@ -12,13 +12,17 @@ return array(
12
  'GuzzleHttp\\Psr7\\CachingStream' => $vendorDir . '/guzzlehttp/psr7/src/CachingStream.php',
13
  'GuzzleHttp\\Psr7\\DroppingStream' => $vendorDir . '/guzzlehttp/psr7/src/DroppingStream.php',
14
  'GuzzleHttp\\Psr7\\FnStream' => $vendorDir . '/guzzlehttp/psr7/src/FnStream.php',
 
15
  'GuzzleHttp\\Psr7\\InflateStream' => $vendorDir . '/guzzlehttp/psr7/src/InflateStream.php',
16
  'GuzzleHttp\\Psr7\\LazyOpenStream' => $vendorDir . '/guzzlehttp/psr7/src/LazyOpenStream.php',
17
  'GuzzleHttp\\Psr7\\LimitStream' => $vendorDir . '/guzzlehttp/psr7/src/LimitStream.php',
 
18
  'GuzzleHttp\\Psr7\\MessageTrait' => $vendorDir . '/guzzlehttp/psr7/src/MessageTrait.php',
 
19
  'GuzzleHttp\\Psr7\\MultipartStream' => $vendorDir . '/guzzlehttp/psr7/src/MultipartStream.php',
20
  'GuzzleHttp\\Psr7\\NoSeekStream' => $vendorDir . '/guzzlehttp/psr7/src/NoSeekStream.php',
21
  'GuzzleHttp\\Psr7\\PumpStream' => $vendorDir . '/guzzlehttp/psr7/src/PumpStream.php',
 
22
  'GuzzleHttp\\Psr7\\Request' => $vendorDir . '/guzzlehttp/psr7/src/Request.php',
23
  'GuzzleHttp\\Psr7\\Response' => $vendorDir . '/guzzlehttp/psr7/src/Response.php',
24
  'GuzzleHttp\\Psr7\\Rfc7230' => $vendorDir . '/guzzlehttp/psr7/src/Rfc7230.php',
@@ -30,6 +34,7 @@ return array(
30
  'GuzzleHttp\\Psr7\\Uri' => $vendorDir . '/guzzlehttp/psr7/src/Uri.php',
31
  'GuzzleHttp\\Psr7\\UriNormalizer' => $vendorDir . '/guzzlehttp/psr7/src/UriNormalizer.php',
32
  'GuzzleHttp\\Psr7\\UriResolver' => $vendorDir . '/guzzlehttp/psr7/src/UriResolver.php',
 
33
  'Http\\Client\\Curl\\Client' => $vendorDir . '/php-http/curl-client/src/Client.php',
34
  'Http\\Client\\Curl\\CurlPromise' => $vendorDir . '/php-http/curl-client/src/CurlPromise.php',
35
  'Http\\Client\\Curl\\MultiRunner' => $vendorDir . '/php-http/curl-client/src/MultiRunner.php',
12
  'GuzzleHttp\\Psr7\\CachingStream' => $vendorDir . '/guzzlehttp/psr7/src/CachingStream.php',
13
  'GuzzleHttp\\Psr7\\DroppingStream' => $vendorDir . '/guzzlehttp/psr7/src/DroppingStream.php',
14
  'GuzzleHttp\\Psr7\\FnStream' => $vendorDir . '/guzzlehttp/psr7/src/FnStream.php',
15
+ 'GuzzleHttp\\Psr7\\Header' => $vendorDir . '/guzzlehttp/psr7/src/Header.php',
16
  'GuzzleHttp\\Psr7\\InflateStream' => $vendorDir . '/guzzlehttp/psr7/src/InflateStream.php',
17
  'GuzzleHttp\\Psr7\\LazyOpenStream' => $vendorDir . '/guzzlehttp/psr7/src/LazyOpenStream.php',
18
  'GuzzleHttp\\Psr7\\LimitStream' => $vendorDir . '/guzzlehttp/psr7/src/LimitStream.php',
19
+ 'GuzzleHttp\\Psr7\\Message' => $vendorDir . '/guzzlehttp/psr7/src/Message.php',
20
  'GuzzleHttp\\Psr7\\MessageTrait' => $vendorDir . '/guzzlehttp/psr7/src/MessageTrait.php',
21
+ 'GuzzleHttp\\Psr7\\MimeType' => $vendorDir . '/guzzlehttp/psr7/src/MimeType.php',
22
  'GuzzleHttp\\Psr7\\MultipartStream' => $vendorDir . '/guzzlehttp/psr7/src/MultipartStream.php',
23
  'GuzzleHttp\\Psr7\\NoSeekStream' => $vendorDir . '/guzzlehttp/psr7/src/NoSeekStream.php',
24
  'GuzzleHttp\\Psr7\\PumpStream' => $vendorDir . '/guzzlehttp/psr7/src/PumpStream.php',
25
+ 'GuzzleHttp\\Psr7\\Query' => $vendorDir . '/guzzlehttp/psr7/src/Query.php',
26
  'GuzzleHttp\\Psr7\\Request' => $vendorDir . '/guzzlehttp/psr7/src/Request.php',
27
  'GuzzleHttp\\Psr7\\Response' => $vendorDir . '/guzzlehttp/psr7/src/Response.php',
28
  'GuzzleHttp\\Psr7\\Rfc7230' => $vendorDir . '/guzzlehttp/psr7/src/Rfc7230.php',
34
  'GuzzleHttp\\Psr7\\Uri' => $vendorDir . '/guzzlehttp/psr7/src/Uri.php',
35
  'GuzzleHttp\\Psr7\\UriNormalizer' => $vendorDir . '/guzzlehttp/psr7/src/UriNormalizer.php',
36
  'GuzzleHttp\\Psr7\\UriResolver' => $vendorDir . '/guzzlehttp/psr7/src/UriResolver.php',
37
+ 'GuzzleHttp\\Psr7\\Utils' => $vendorDir . '/guzzlehttp/psr7/src/Utils.php',
38
  'Http\\Client\\Curl\\Client' => $vendorDir . '/php-http/curl-client/src/Client.php',
39
  'Http\\Client\\Curl\\CurlPromise' => $vendorDir . '/php-http/curl-client/src/CurlPromise.php',
40
  'Http\\Client\\Curl\\MultiRunner' => $vendorDir . '/php-http/curl-client/src/MultiRunner.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitbb1a79a4d05fe887c823fb7fce639c4c
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitbb1a79a4d05fe887c823fb7fce639c4c
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitbb1a79a4d05fe887c823fb7fce639c4c', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInitbb1a79a4d05fe887c823fb7fce639c4c', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInitbb1a79a4d05fe887c823fb7fce639c4c
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequirebb1a79a4d05fe887c823fb7fce639c4c($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequirebb1a79a4d05fe887c823fb7fce639c4c($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit66e4adc309d0c4c6bf763eebd4bb9918
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit66e4adc309d0c4c6bf763eebd4bb9918', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit66e4adc309d0c4c6bf763eebd4bb9918', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit66e4adc309d0c4c6bf763eebd4bb9918::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit66e4adc309d0c4c6bf763eebd4bb9918::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire66e4adc309d0c4c6bf763eebd4bb9918($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire66e4adc309d0c4c6bf763eebd4bb9918($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
@@ -106,13 +106,17 @@ class ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c
106
  'GuzzleHttp\\Psr7\\CachingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/CachingStream.php',
107
  'GuzzleHttp\\Psr7\\DroppingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/DroppingStream.php',
108
  'GuzzleHttp\\Psr7\\FnStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/FnStream.php',
 
109
  'GuzzleHttp\\Psr7\\InflateStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/InflateStream.php',
110
  'GuzzleHttp\\Psr7\\LazyOpenStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LazyOpenStream.php',
111
  'GuzzleHttp\\Psr7\\LimitStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LimitStream.php',
 
112
  'GuzzleHttp\\Psr7\\MessageTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MessageTrait.php',
 
113
  'GuzzleHttp\\Psr7\\MultipartStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MultipartStream.php',
114
  'GuzzleHttp\\Psr7\\NoSeekStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/NoSeekStream.php',
115
  'GuzzleHttp\\Psr7\\PumpStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/PumpStream.php',
 
116
  'GuzzleHttp\\Psr7\\Request' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Request.php',
117
  'GuzzleHttp\\Psr7\\Response' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Response.php',
118
  'GuzzleHttp\\Psr7\\Rfc7230' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Rfc7230.php',
@@ -124,6 +128,7 @@ class ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c
124
  'GuzzleHttp\\Psr7\\Uri' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Uri.php',
125
  'GuzzleHttp\\Psr7\\UriNormalizer' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriNormalizer.php',
126
  'GuzzleHttp\\Psr7\\UriResolver' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriResolver.php',
 
127
  'Http\\Client\\Curl\\Client' => __DIR__ . '/..' . '/php-http/curl-client/src/Client.php',
128
  'Http\\Client\\Curl\\CurlPromise' => __DIR__ . '/..' . '/php-http/curl-client/src/CurlPromise.php',
129
  'Http\\Client\\Curl\\MultiRunner' => __DIR__ . '/..' . '/php-http/curl-client/src/MultiRunner.php',
@@ -264,9 +269,9 @@ class ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c
264
  public static function getInitializer(ClassLoader $loader)
265
  {
266
  return \Closure::bind(function () use ($loader) {
267
- $loader->prefixLengthsPsr4 = ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c::$prefixLengthsPsr4;
268
- $loader->prefixDirsPsr4 = ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c::$prefixDirsPsr4;
269
- $loader->classMap = ComposerStaticInitbb1a79a4d05fe887c823fb7fce639c4c::$classMap;
270
 
271
  }, null, ClassLoader::class);
272
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit66e4adc309d0c4c6bf763eebd4bb9918
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
106
  'GuzzleHttp\\Psr7\\CachingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/CachingStream.php',
107
  'GuzzleHttp\\Psr7\\DroppingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/DroppingStream.php',
108
  'GuzzleHttp\\Psr7\\FnStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/FnStream.php',
109
+ 'GuzzleHttp\\Psr7\\Header' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Header.php',
110
  'GuzzleHttp\\Psr7\\InflateStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/InflateStream.php',
111
  'GuzzleHttp\\Psr7\\LazyOpenStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LazyOpenStream.php',
112
  'GuzzleHttp\\Psr7\\LimitStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LimitStream.php',
113
+ 'GuzzleHttp\\Psr7\\Message' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Message.php',
114
  'GuzzleHttp\\Psr7\\MessageTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MessageTrait.php',
115
+ 'GuzzleHttp\\Psr7\\MimeType' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MimeType.php',
116
  'GuzzleHttp\\Psr7\\MultipartStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MultipartStream.php',
117
  'GuzzleHttp\\Psr7\\NoSeekStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/NoSeekStream.php',
118
  'GuzzleHttp\\Psr7\\PumpStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/PumpStream.php',
119
+ 'GuzzleHttp\\Psr7\\Query' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Query.php',
120
  'GuzzleHttp\\Psr7\\Request' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Request.php',
121
  'GuzzleHttp\\Psr7\\Response' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Response.php',
122
  'GuzzleHttp\\Psr7\\Rfc7230' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Rfc7230.php',
128
  'GuzzleHttp\\Psr7\\Uri' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Uri.php',
129
  'GuzzleHttp\\Psr7\\UriNormalizer' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriNormalizer.php',
130
  'GuzzleHttp\\Psr7\\UriResolver' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriResolver.php',
131
+ 'GuzzleHttp\\Psr7\\Utils' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Utils.php',
132
  'Http\\Client\\Curl\\Client' => __DIR__ . '/..' . '/php-http/curl-client/src/Client.php',
133
  'Http\\Client\\Curl\\CurlPromise' => __DIR__ . '/..' . '/php-http/curl-client/src/CurlPromise.php',
134
  'Http\\Client\\Curl\\MultiRunner' => __DIR__ . '/..' . '/php-http/curl-client/src/MultiRunner.php',
269
  public static function getInitializer(ClassLoader $loader)
270
  {
271
  return \Closure::bind(function () use ($loader) {
272
+ $loader->prefixLengthsPsr4 = ComposerStaticInit66e4adc309d0c4c6bf763eebd4bb9918::$prefixLengthsPsr4;
273
+ $loader->prefixDirsPsr4 = ComposerStaticInit66e4adc309d0c4c6bf763eebd4bb9918::$prefixDirsPsr4;
274
+ $loader->classMap = ComposerStaticInit66e4adc309d0c4c6bf763eebd4bb9918::$classMap;
275
 
276
  }, null, ClassLoader::class);
277
  }
vendor/composer/installed.json CHANGED
@@ -1,26 +1,26 @@
1
  [
2
  {
3
  "name": "clue/stream-filter",
4
- "version": "v1.4.1",
5
- "version_normalized": "1.4.1.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/clue/php-stream-filter.git",
9
- "reference": "5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71",
14
- "reference": "5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71",
15
  "shasum": ""
16
  },
17
  "require": {
18
  "php": ">=5.3"
19
  },
20
  "require-dev": {
21
- "phpunit/phpunit": "^5.0 || ^4.8"
22
  },
23
- "time": "2019-04-09T12:31:48+00:00",
24
  "type": "library",
25
  "installation-source": "dist",
26
  "autoload": {
@@ -38,7 +38,7 @@
38
  "authors": [
39
  {
40
  "name": "Christian Lück",
41
- "email": "christian@lueck.tv"
42
  }
43
  ],
44
  "description": "A simple and modern approach to stream filtering in PHP",
@@ -51,6 +51,16 @@
51
  "stream",
52
  "stream_filter_append",
53
  "stream_filter_register"
 
 
 
 
 
 
 
 
 
 
54
  ]
55
  },
56
  {
@@ -298,17 +308,17 @@
298
  },
299
  {
300
  "name": "guzzlehttp/psr7",
301
- "version": "1.6.1",
302
- "version_normalized": "1.6.1.0",
303
  "source": {
304
  "type": "git",
305
  "url": "https://github.com/guzzle/psr7.git",
306
- "reference": "239400de7a173fe9901b9ac7c06497751f00727a"
307
  },
308
  "dist": {
309
  "type": "zip",
310
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a",
311
- "reference": "239400de7a173fe9901b9ac7c06497751f00727a",
312
  "shasum": ""
313
  },
314
  "require": {
@@ -321,16 +331,16 @@
321
  },
322
  "require-dev": {
323
  "ext-zlib": "*",
324
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
325
  },
326
  "suggest": {
327
- "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
328
  },
329
- "time": "2019-07-01T23:21:34+00:00",
330
  "type": "library",
331
  "extra": {
332
  "branch-alias": {
333
- "dev-master": "1.6-dev"
334
  }
335
  },
336
  "installation-source": "dist",
@@ -419,17 +429,17 @@
419
  },
420
  {
421
  "name": "masterminds/html5",
422
- "version": "2.7.3",
423
- "version_normalized": "2.7.3.0",
424
  "source": {
425
  "type": "git",
426
  "url": "https://github.com/Masterminds/html5-php.git",
427
- "reference": "aad73dbfefd71d46072138109ce1288d96c329cc"
428
  },
429
  "dist": {
430
  "type": "zip",
431
- "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/aad73dbfefd71d46072138109ce1288d96c329cc",
432
- "reference": "aad73dbfefd71d46072138109ce1288d96c329cc",
433
  "shasum": ""
434
  },
435
  "require": {
@@ -439,11 +449,9 @@
439
  "php": ">=5.3.0"
440
  },
441
  "require-dev": {
442
- "phpunit/phpunit": "^4.8.35",
443
- "sami/sami": "~2.0",
444
- "satooshi/php-coveralls": "1.0.*"
445
  },
446
- "time": "2020-07-05T07:53:37+00:00",
447
  "type": "library",
448
  "extra": {
449
  "branch-alias": {
1
  [
2
  {
3
  "name": "clue/stream-filter",
4
+ "version": "v1.5.0",
5
+ "version_normalized": "1.5.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/clue/php-stream-filter.git",
9
+ "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320",
14
+ "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320",
15
  "shasum": ""
16
  },
17
  "require": {
18
  "php": ">=5.3"
19
  },
20
  "require-dev": {
21
+ "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
22
  },
23
+ "time": "2020-10-02T12:38:20+00:00",
24
  "type": "library",
25
  "installation-source": "dist",
26
  "autoload": {
38
  "authors": [
39
  {
40
  "name": "Christian Lück",
41
+ "email": "christian@clue.engineering"
42
  }
43
  ],
44
  "description": "A simple and modern approach to stream filtering in PHP",
51
  "stream",
52
  "stream_filter_append",
53
  "stream_filter_register"
54
+ ],
55
+ "funding": [
56
+ {
57
+ "url": "https://clue.engineering/support",
58
+ "type": "custom"
59
+ },
60
+ {
61
+ "url": "https://github.com/clue",
62
+ "type": "github"
63
+ }
64
  ]
65
  },
66
  {
308
  },
309
  {
310
  "name": "guzzlehttp/psr7",
311
+ "version": "1.7.0",
312
+ "version_normalized": "1.7.0.0",
313
  "source": {
314
  "type": "git",
315
  "url": "https://github.com/guzzle/psr7.git",
316
+ "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3"
317
  },
318
  "dist": {
319
  "type": "zip",
320
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3",
321
+ "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3",
322
  "shasum": ""
323
  },
324
  "require": {
331
  },
332
  "require-dev": {
333
  "ext-zlib": "*",
334
+ "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
335
  },
336
  "suggest": {
337
+ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
338
  },
339
+ "time": "2020-09-30T07:37:11+00:00",
340
  "type": "library",
341
  "extra": {
342
  "branch-alias": {
343
+ "dev-master": "1.7-dev"
344
  }
345
  },
346
  "installation-source": "dist",
429
  },
430
  {
431
  "name": "masterminds/html5",
432
+ "version": "2.7.4",
433
+ "version_normalized": "2.7.4.0",
434
  "source": {
435
  "type": "git",
436
  "url": "https://github.com/Masterminds/html5-php.git",
437
+ "reference": "9227822783c75406cfe400984b2f095cdf03d417"
438
  },
439
  "dist": {
440
  "type": "zip",
441
+ "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/9227822783c75406cfe400984b2f095cdf03d417",
442
+ "reference": "9227822783c75406cfe400984b2f095cdf03d417",
443
  "shasum": ""
444
  },
445
  "require": {
449
  "php": ">=5.3.0"
450
  },
451
  "require-dev": {
452
+ "phpunit/phpunit": "^4.8.35"
 
 
453
  },
454
+ "time": "2020-10-01T13:52:52+00:00",
455
  "type": "library",
456
  "extra": {
457
  "branch-alias": {
vendor/guzzlehttp/psr7/CHANGELOG.md CHANGED
@@ -9,8 +9,32 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9
 
10
  ## [Unreleased]
11
 
 
12
 
13
- ## [1.6.0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  ### Added
16
 
9
 
10
  ## [Unreleased]
11
 
12
+ ## [1.7.0] - 2020-09-30
13
 
14
+ ### Added
15
+
16
+ - Replaced functions by static methods
17
+
18
+ ### Fixed
19
+
20
+ - Converting a non-seekable stream to a string
21
+ - Handle multiple Set-Cookie correctly
22
+ - Ignore array keys in header values when merging
23
+ - Allow multibyte characters to be parsed in `Message:bodySummary()`
24
+
25
+ ### Changed
26
+
27
+ - Restored partial HHVM 3 support
28
+
29
+
30
+ ## [1.6.1] - 2019-07-02
31
+
32
+ ### Fixed
33
+
34
+ - Accept null and bool header values again
35
+
36
+
37
+ ## [1.6.0] - 2019-06-30
38
 
39
  ### Added
40
 
vendor/guzzlehttp/psr7/README.md CHANGED
@@ -23,11 +23,11 @@ Reads from multiple streams, one after the other.
23
  ```php
24
  use GuzzleHttp\Psr7;
25
 
26
- $a = Psr7\stream_for('abc, ');
27
- $b = Psr7\stream_for('123.');
28
  $composed = new Psr7\AppendStream([$a, $b]);
29
 
30
- $composed->addStream(Psr7\stream_for(' Above all listen to me'));
31
 
32
  echo $composed; // abc, 123. Above all listen to me.
33
  ```
@@ -65,7 +65,7 @@ then on disk.
65
  ```php
66
  use GuzzleHttp\Psr7;
67
 
68
- $original = Psr7\stream_for(fopen('http://www.google.com', 'r'));
69
  $stream = new Psr7\CachingStream($original);
70
 
71
  $stream->read(1024);
@@ -89,7 +89,7 @@ stream becomes too full.
89
  use GuzzleHttp\Psr7;
90
 
91
  // Create an empty stream
92
- $stream = Psr7\stream_for();
93
 
94
  // Start dropping data when the stream has more than 10 bytes
95
  $dropping = new Psr7\DroppingStream($stream, 10);
@@ -112,7 +112,7 @@ to create a concrete class for a simple extension point.
112
 
113
  use GuzzleHttp\Psr7;
114
 
115
- $stream = Psr7\stream_for('hi');
116
  $fnStream = Psr7\FnStream::decorate($stream, [
117
  'rewind' => function () use ($stream) {
118
  echo 'About to rewind - ';
@@ -167,7 +167,7 @@ chunks (e.g. Amazon S3's multipart upload API).
167
  ```php
168
  use GuzzleHttp\Psr7;
169
 
170
- $original = Psr7\stream_for(fopen('/tmp/test.txt', 'r+'));
171
  echo $original->getSize();
172
  // >>> 1048576
173
 
@@ -197,7 +197,7 @@ NoSeekStream wraps a stream and does not allow seeking.
197
  ```php
198
  use GuzzleHttp\Psr7;
199
 
200
- $original = Psr7\stream_for('foo');
201
  $noSeek = new Psr7\NoSeekStream($original);
202
 
203
  echo $noSeek->read(3);
@@ -271,7 +271,7 @@ This decorator could be added to any existing stream and used like so:
271
  ```php
272
  use GuzzleHttp\Psr7;
273
 
274
- $original = Psr7\stream_for('foo');
275
 
276
  $eofStream = new EofCallbackStream($original, function () {
277
  echo 'EOF!';
@@ -297,228 +297,292 @@ stream from a PSR-7 stream.
297
  ```php
298
  use GuzzleHttp\Psr7\StreamWrapper;
299
 
300
- $stream = GuzzleHttp\Psr7\stream_for('hello!');
301
  $resource = StreamWrapper::getResource($stream);
302
  echo fread($resource, 6); // outputs hello!
303
  ```
304
 
305
 
306
- # Function API
307
 
308
- There are various functions available under the `GuzzleHttp\Psr7` namespace.
309
 
310
 
311
- ## `function str`
312
 
313
- `function str(MessageInterface $message)`
314
 
315
  Returns the string representation of an HTTP message.
316
 
317
  ```php
318
  $request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com');
319
- echo GuzzleHttp\Psr7\str($request);
320
  ```
321
 
322
 
323
- ## `function uri_for`
324
 
325
- `function uri_for($uri)`
326
 
327
- This function accepts a string or `Psr\Http\Message\UriInterface` and returns a
328
- UriInterface for the given value. If the value is already a `UriInterface`, it
329
- is returned as-is.
330
 
331
- ```php
332
- $uri = GuzzleHttp\Psr7\uri_for('http://example.com');
333
- assert($uri === GuzzleHttp\Psr7\uri_for($uri));
334
- ```
335
 
336
 
337
- ## `function stream_for`
338
 
339
- `function stream_for($resource = '', array $options = [])`
340
 
341
- Create a new stream based on the input type.
342
 
343
- Options is an associative array that can contain the following keys:
 
344
 
345
- * - metadata: Array of custom metadata.
346
- * - size: Size of the stream.
347
 
348
- This method accepts the following `$resource` types:
349
 
350
- - `Psr\Http\Message\StreamInterface`: Returns the value as-is.
351
- - `string`: Creates a stream object that uses the given string as the contents.
352
- - `resource`: Creates a stream object that wraps the given PHP stream resource.
353
- - `Iterator`: If the provided value implements `Iterator`, then a read-only
354
- stream object will be created that wraps the given iterable. Each time the
355
- stream is read from, data from the iterator will fill a buffer and will be
356
- continuously called until the buffer is equal to the requested read size.
357
- Subsequent read calls will first read from the buffer and then call `next`
358
- on the underlying iterator until it is exhausted.
359
- - `object` with `__toString()`: If the object has the `__toString()` method,
360
- the object will be cast to a string and then a stream will be returned that
361
- uses the string value.
362
- - `NULL`: When `null` is passed, an empty stream object is returned.
363
- - `callable` When a callable is passed, a read-only stream object will be
364
- created that invokes the given callable. The callable is invoked with the
365
- number of suggested bytes to read. The callable can return any number of
366
- bytes, but MUST return `false` when there is no more data to return. The
367
- stream object that wraps the callable will invoke the callable until the
368
- number of requested bytes are available. Any additional bytes will be
369
- buffered and used in subsequent reads.
370
 
371
- ```php
372
- $stream = GuzzleHttp\Psr7\stream_for('foo');
373
- $stream = GuzzleHttp\Psr7\stream_for(fopen('/path/to/file', 'r'));
374
 
375
- $generator = function ($bytes) {
376
- for ($i = 0; $i < $bytes; $i++) {
377
- yield ' ';
378
- }
379
- }
380
 
381
- $stream = GuzzleHttp\Psr7\stream_for($generator(100));
382
- ```
383
 
 
384
 
385
- ## `function parse_header`
386
 
387
- `function parse_header($header)`
388
 
389
- Parse an array of header values containing ";" separated data into an array of
390
- associative arrays representing the header key value pair data of the header.
391
- When a parameter does not contain a value, but just contains a key, this
392
- function will inject a key with a '' string value.
393
 
 
394
 
395
- ## `function normalize_header`
396
 
397
- `function normalize_header($header)`
398
 
399
- Converts an array of header values that may contain comma separated headers
400
- into an array of headers with no comma separated values.
401
 
 
402
 
403
- ## `function modify_request`
404
 
405
- `function modify_request(RequestInterface $request, array $changes)`
406
 
407
- Clone and modify a request with the given changes. This method is useful for
408
- reducing the number of clones needed to mutate a message.
409
 
410
- The changes can be one of:
411
 
412
- - method: (string) Changes the HTTP method.
413
- - set_headers: (array) Sets the given headers.
414
- - remove_headers: (array) Remove the given headers.
415
- - body: (mixed) Sets the given body.
416
- - uri: (UriInterface) Set the URI.
417
- - query: (string) Set the query string value of the URI.
418
- - version: (string) Set the protocol version.
419
 
 
 
 
 
420
 
421
- ## `function rewind_body`
422
 
423
- `function rewind_body(MessageInterface $message)`
424
 
425
- Attempts to rewind a message body and throws an exception on failure. The body
426
- of the message will only be rewound if a call to `tell()` returns a value other
427
- than `0`.
428
 
 
 
429
 
430
- ## `function try_fopen`
431
 
432
- `function try_fopen($filename, $mode)`
433
 
434
- Safely opens a PHP stream resource using a filename.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
 
436
- When fopen fails, PHP normally raises a warning. This function adds an error
437
- handler that checks for errors and throws an exception instead.
438
 
439
 
440
- ## `function copy_to_string`
441
 
442
- `function copy_to_string(StreamInterface $stream, $maxLen = -1)`
443
 
444
- Copy the contents of a stream into a string until the given number of bytes
445
- have been read.
446
 
447
 
448
- ## `function copy_to_stream`
449
 
450
- `function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)`
451
 
452
- Copy the contents of a stream into another stream until the given number of
453
  bytes have been read.
454
 
455
 
456
- ## `function hash`
457
 
458
- `function hash(StreamInterface $stream, $algo, $rawOutput = false)`
459
 
460
- Calculate a hash of a Stream. This method reads the entire stream to calculate
461
- a rolling hash (based on PHP's hash_init functions).
462
 
 
 
463
 
464
- ## `function readline`
465
 
466
- `function readline(StreamInterface $stream, $maxLength = null)`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
 
468
  Read a line from the stream up to the maximum allowed buffer length.
469
 
470
 
471
- ## `function parse_request`
472
 
473
- `function parse_request($message)`
474
 
475
- Parses a request message string into a request object.
476
 
 
477
 
478
- ## `function parse_response`
 
479
 
480
- `function parse_response($message)`
481
 
482
- Parses a response message string into a response object.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
 
 
 
 
484
 
485
- ## `function parse_query`
 
 
 
 
486
 
487
- `function parse_query($str, $urlEncoding = true)`
 
488
 
489
- Parse a query string into an associative array.
490
 
491
- If multiple values are found for the same key, the value of that key value pair
492
- will become an array. This function does not parse nested PHP style arrays into
493
- an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed into
494
- `['foo[a]' => '1', 'foo[b]' => '2']`).
495
 
 
496
 
497
- ## `function build_query`
498
 
499
- `function build_query(array $params, $encoding = PHP_QUERY_RFC3986)`
 
500
 
501
- Build a query string from an array of key value pairs.
502
 
503
- This function can use the return value of parse_query() to build a query string.
504
- This function does not modify the provided keys when an array is encountered
505
- (like http_build_query would).
 
 
506
 
 
 
 
507
 
508
- ## `function mimetype_from_filename`
509
 
510
- `function mimetype_from_filename($filename)`
 
 
511
 
512
  Determines the mimetype of a file by looking at its extension.
513
 
514
 
515
- ## `function mimetype_from_extension`
516
 
517
- `function mimetype_from_extension($extension)`
518
 
519
  Maps a file extensions to a mimetype.
520
 
521
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
522
  # Additional URI Methods
523
 
524
  Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class,
23
  ```php
24
  use GuzzleHttp\Psr7;
25
 
26
+ $a = Psr7\Utils::streamFor('abc, ');
27
+ $b = Psr7\Utils::streamFor('123.');
28
  $composed = new Psr7\AppendStream([$a, $b]);
29
 
30
+ $composed->addStream(Psr7\Utils::streamFor(' Above all listen to me'));
31
 
32
  echo $composed; // abc, 123. Above all listen to me.
33
  ```
65
  ```php
66
  use GuzzleHttp\Psr7;
67
 
68
+ $original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r'));
69
  $stream = new Psr7\CachingStream($original);
70
 
71
  $stream->read(1024);
89
  use GuzzleHttp\Psr7;
90
 
91
  // Create an empty stream
92
+ $stream = Psr7\Utils::streamFor();
93
 
94
  // Start dropping data when the stream has more than 10 bytes
95
  $dropping = new Psr7\DroppingStream($stream, 10);
112
 
113
  use GuzzleHttp\Psr7;
114
 
115
+ $stream = Psr7\Utils::streamFor('hi');
116
  $fnStream = Psr7\FnStream::decorate($stream, [
117
  'rewind' => function () use ($stream) {
118
  echo 'About to rewind - ';
167
  ```php
168
  use GuzzleHttp\Psr7;
169
 
170
+ $original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+'));
171
  echo $original->getSize();
172
  // >>> 1048576
173
 
197
  ```php
198
  use GuzzleHttp\Psr7;
199
 
200
+ $original = Psr7\Utils::streamFor('foo');
201
  $noSeek = new Psr7\NoSeekStream($original);
202
 
203
  echo $noSeek->read(3);
271
  ```php
272
  use GuzzleHttp\Psr7;
273
 
274
+ $original = Psr7\Utils::streamFor('foo');
275
 
276
  $eofStream = new EofCallbackStream($original, function () {
277
  echo 'EOF!';
297
  ```php
298
  use GuzzleHttp\Psr7\StreamWrapper;
299
 
300
+ $stream = GuzzleHttp\Psr7\Utils::streamFor('hello!');
301
  $resource = StreamWrapper::getResource($stream);
302
  echo fread($resource, 6); // outputs hello!
303
  ```
304
 
305
 
306
+ # Static API
307
 
308
+ There are various static methods available under the `GuzzleHttp\Psr7` namespace.
309
 
310
 
311
+ ## `GuzzleHttp\Psr7\Message::toString`
312
 
313
+ `public static function toString(MessageInterface $message): string`
314
 
315
  Returns the string representation of an HTTP message.
316
 
317
  ```php
318
  $request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com');
319
+ echo GuzzleHttp\Psr7\Message::toString($request);
320
  ```
321
 
322
 
323
+ ## `GuzzleHttp\Psr7\Message::bodySummary`
324
 
325
+ `public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null`
326
 
327
+ Get a short summary of the message body.
 
 
328
 
329
+ Will return `null` if the response is not printable.
 
 
 
330
 
331
 
332
+ ## `GuzzleHttp\Psr7\Message::rewindBody`
333
 
334
+ `public static function rewindBody(MessageInterface $message): void`
335
 
336
+ Attempts to rewind a message body and throws an exception on failure.
337
 
338
+ The body of the message will only be rewound if a call to `tell()`
339
+ returns a value other than `0`.
340
 
 
 
341
 
342
+ ## `GuzzleHttp\Psr7\Message::parseMessage`
343
 
344
+ `public static function parseMessage(string $message): array`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
 
346
+ Parses an HTTP message into an associative array.
 
 
347
 
348
+ The array contains the "start-line" key containing the start line of
349
+ the message, "headers" key containing an associative array of header
350
+ array values, and a "body" key containing the body of the message.
 
 
351
 
 
 
352
 
353
+ ## `GuzzleHttp\Psr7\Message::parseRequestUri`
354
 
355
+ `public static function parseRequestUri(string $path, array $headers): string`
356
 
357
+ Constructs a URI for an HTTP request message.
358
 
 
 
 
 
359
 
360
+ ## `GuzzleHttp\Psr7\Message::parseRequest`
361
 
362
+ `public static function parseRequest(string $message): Request`
363
 
364
+ Parses a request message string into a request object.
365
 
 
 
366
 
367
+ ## `GuzzleHttp\Psr7\Message::parseResponse`
368
 
369
+ `public static function parseResponse(string $message): Response`
370
 
371
+ Parses a response message string into a response object.
372
 
 
 
373
 
374
+ ## `GuzzleHttp\Psr7\Header::parse`
375
 
376
+ `public static function parse(string|array $header): array`
 
 
 
 
 
 
377
 
378
+ Parse an array of header values containing ";" separated data into an
379
+ array of associative arrays representing the header key value pair data
380
+ of the header. When a parameter does not contain a value, but just
381
+ contains a key, this function will inject a key with a '' string value.
382
 
 
383
 
384
+ ## `GuzzleHttp\Psr7\Header::normalize`
385
 
386
+ `public static function normalize(string|array $header): array`
 
 
387
 
388
+ Converts an array of header values that may contain comma separated
389
+ headers into an array of headers with no comma separated values.
390
 
 
391
 
392
+ ## `GuzzleHttp\Psr7\Query::parse`
393
 
394
+ `public static function parse(string $str, int|bool $urlEncoding = true): array`
395
+
396
+ Parse a query string into an associative array.
397
+
398
+ If multiple values are found for the same key, the value of that key
399
+ value pair will become an array. This function does not parse nested
400
+ PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2`
401
+ will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`.
402
+
403
+
404
+ ## `GuzzleHttp\Psr7\Query::build`
405
+
406
+ `public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string`
407
+
408
+ Build a query string from an array of key value pairs.
409
+
410
+ This function can use the return value of `parse()` to build a query
411
+ string. This function does not modify the provided keys when an array is
412
+ encountered (like `http_build_query()` would).
413
+
414
+
415
+ ## `GuzzleHttp\Psr7\Utils::caselessRemove`
416
+
417
+ `public static function caselessRemove(iterable<string> $keys, $keys, array $data): array`
418
 
419
+ Remove the items given by the keys, case insensitively from the data.
 
420
 
421
 
422
+ ## `GuzzleHttp\Psr7\Utils::copyToStream`
423
 
424
+ `public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void`
425
 
426
+ Copy the contents of a stream into another stream until the given number
427
+ of bytes have been read.
428
 
429
 
430
+ ## `GuzzleHttp\Psr7\Utils::copyToString`
431
 
432
+ `public static function copyToString(StreamInterface $stream, int $maxLen = -1): string`
433
 
434
+ Copy the contents of a stream into a string until the given number of
435
  bytes have been read.
436
 
437
 
438
+ ## `GuzzleHttp\Psr7\Utils::hash`
439
 
440
+ `public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string`
441
 
442
+ Calculate a hash of a stream.
 
443
 
444
+ This method reads the entire stream to calculate a rolling hash, based on
445
+ PHP's `hash_init` functions.
446
 
 
447
 
448
+ ## `GuzzleHttp\Psr7\Utils::modifyRequest`
449
+
450
+ `public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface`
451
+
452
+ Clone and modify a request with the given changes.
453
+
454
+ This method is useful for reducing the number of clones needed to mutate
455
+ a message.
456
+
457
+ - method: (string) Changes the HTTP method.
458
+ - set_headers: (array) Sets the given headers.
459
+ - remove_headers: (array) Remove the given headers.
460
+ - body: (mixed) Sets the given body.
461
+ - uri: (UriInterface) Set the URI.
462
+ - query: (string) Set the query string value of the URI.
463
+ - version: (string) Set the protocol version.
464
+
465
+
466
+ ## `GuzzleHttp\Psr7\Utils::readLine`
467
+
468
+ `public static function readLine(StreamInterface $stream, int $maxLength = null): string`
469
 
470
  Read a line from the stream up to the maximum allowed buffer length.
471
 
472
 
473
+ ## `GuzzleHttp\Psr7\Utils::streamFor`
474
 
475
+ `public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface`
476
 
477
+ Create a new stream based on the input type.
478
 
479
+ Options is an associative array that can contain the following keys:
480
 
481
+ - metadata: Array of custom metadata.
482
+ - size: Size of the stream.
483
 
484
+ This method accepts the following `$resource` types:
485
 
486
+ - `Psr\Http\Message\StreamInterface`: Returns the value as-is.
487
+ - `string`: Creates a stream object that uses the given string as the contents.
488
+ - `resource`: Creates a stream object that wraps the given PHP stream resource.
489
+ - `Iterator`: If the provided value implements `Iterator`, then a read-only
490
+ stream object will be created that wraps the given iterable. Each time the
491
+ stream is read from, data from the iterator will fill a buffer and will be
492
+ continuously called until the buffer is equal to the requested read size.
493
+ Subsequent read calls will first read from the buffer and then call `next`
494
+ on the underlying iterator until it is exhausted.
495
+ - `object` with `__toString()`: If the object has the `__toString()` method,
496
+ the object will be cast to a string and then a stream will be returned that
497
+ uses the string value.
498
+ - `NULL`: When `null` is passed, an empty stream object is returned.
499
+ - `callable` When a callable is passed, a read-only stream object will be
500
+ created that invokes the given callable. The callable is invoked with the
501
+ number of suggested bytes to read. The callable can return any number of
502
+ bytes, but MUST return `false` when there is no more data to return. The
503
+ stream object that wraps the callable will invoke the callable until the
504
+ number of requested bytes are available. Any additional bytes will be
505
+ buffered and used in subsequent reads.
506
 
507
+ ```php
508
+ $stream = GuzzleHttp\Psr7\Utils::streamFor('foo');
509
+ $stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r'));
510
 
511
+ $generator = function ($bytes) {
512
+ for ($i = 0; $i < $bytes; $i++) {
513
+ yield ' ';
514
+ }
515
+ }
516
 
517
+ $stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100));
518
+ ```
519
 
 
520
 
521
+ ## `GuzzleHttp\Psr7\Utils::tryFopen`
 
 
 
522
 
523
+ `public static function tryFopen(string $filename, string $mode): resource`
524
 
525
+ Safely opens a PHP stream resource using a filename.
526
 
527
+ When fopen fails, PHP normally raises a warning. This function adds an
528
+ error handler that checks for errors and throws an exception instead.
529
 
 
530
 
531
+ ## `GuzzleHttp\Psr7\Utils::uriFor`
532
+
533
+ `public static function uriFor(string|UriInterface $uri): UriInterface`
534
+
535
+ Returns a UriInterface for the given value.
536
 
537
+ This function accepts a string or UriInterface and returns a
538
+ UriInterface for the given value. If the value is already a
539
+ UriInterface, it is returned as-is.
540
 
 
541
 
542
+ ## `GuzzleHttp\Psr7\MimeType::fromFilename`
543
+
544
+ `public static function fromFilename(string $filename): string|null`
545
 
546
  Determines the mimetype of a file by looking at its extension.
547
 
548
 
549
+ ## `GuzzleHttp\Psr7\MimeType::fromExtension`
550
 
551
+ `public static function fromExtension(string $extension): string|null`
552
 
553
  Maps a file extensions to a mimetype.
554
 
555
 
556
+ ## Upgrading from Function API
557
+
558
+ The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience:
559
+
560
+ | Original Function | Replacement Method |
561
+ |----------------|----------------|
562
+ | `str` | `Message::toString` |
563
+ | `uri_for` | `Utils::uriFor` |
564
+ | `stream_for` | `Utils::streamFor` |
565
+ | `parse_header` | `Header::parse` |
566
+ | `normalize_header` | `Header::normalize` |
567
+ | `modify_request` | `Utils::modifyRequest` |
568
+ | `rewind_body` | `Message::rewindBody` |
569
+ | `try_fopen` | `Utils::tryFopen` |
570
+ | `copy_to_string` | `Utils::copyToString` |
571
+ | `copy_to_stream` | `Utils::copyToStream` |
572
+ | `hash` | `Utils::hash` |
573
+ | `readline` | `Utils::readLine` |
574
+ | `parse_request` | `Message::parseRequest` |
575
+ | `parse_response` | `Message::parseResponse` |
576
+ | `parse_query` | `Query::parse` |
577
+ | `build_query` | `Query::build` |
578
+ | `mimetype_from_filename` | `MimeType::fromFilename` |
579
+ | `mimetype_from_extension` | `MimeType::fromExtension` |
580
+ | `_parse_message` | `Message::parseMessage` |
581
+ | `_parse_request_uri` | `Message::parseRequestUri` |
582
+ | `get_message_body_summary` | `Message::bodySummary` |
583
+ | `_caseless_remove` | `Utils::caselessRemove` |
584
+
585
+
586
  # Additional URI Methods
587
 
588
  Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class,
vendor/guzzlehttp/psr7/src/AppendStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -61,7 +62,7 @@ class AppendStream implements StreamInterface
61
 
62
  public function getContents()
63
  {
64
- return copy_to_string($this);
65
  }
66
 
67
  /**
@@ -98,6 +99,8 @@ class AppendStream implements StreamInterface
98
  }
99
 
100
  $this->streams = [];
 
 
101
  }
102
 
103
  public function tell()
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
62
 
63
  public function getContents()
64
  {
65
+ return Utils::copyToString($this);
66
  }
67
 
68
  /**
99
  }
100
 
101
  $this->streams = [];
102
+
103
+ return null;
104
  }
105
 
106
  public function tell()
vendor/guzzlehttp/psr7/src/BufferStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -49,6 +50,8 @@ class BufferStream implements StreamInterface
49
  public function detach()
50
  {
51
  $this->close();
 
 
52
  }
53
 
54
  public function getSize()
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
50
  public function detach()
51
  {
52
  $this->close();
53
+
54
+ return null;
55
  }
56
 
57
  public function getSize()
vendor/guzzlehttp/psr7/src/CachingStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -131,7 +132,7 @@ class CachingStream implements StreamInterface
131
  private function cacheEntireStream()
132
  {
133
  $target = new FnStream(['write' => 'strlen']);
134
- copy_to_stream($this, $target);
135
 
136
  return $this->tell();
137
  }
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
132
  private function cacheEntireStream()
133
  {
134
  $target = new FnStream(['write' => 'strlen']);
135
+ Utils::copyToStream($this, $target);
136
 
137
  return $this->tell();
138
  }
vendor/guzzlehttp/psr7/src/DroppingStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
vendor/guzzlehttp/psr7/src/FnStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -34,6 +35,7 @@ class FnStream implements StreamInterface
34
 
35
  /**
36
  * Lazily determine which methods are not implemented.
 
37
  * @throws \BadMethodCallException
38
  */
39
  public function __get($name)
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
35
 
36
  /**
37
  * Lazily determine which methods are not implemented.
38
+ *
39
  * @throws \BadMethodCallException
40
  */
41
  public function __get($name)
vendor/guzzlehttp/psr7/src/Header.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace GuzzleHttp\Psr7;
4
+
5
+ final class Header
6
+ {
7
+ /**
8
+ * Parse an array of header values containing ";" separated data into an
9
+ * array of associative arrays representing the header key value pair data
10
+ * of the header. When a parameter does not contain a value, but just
11
+ * contains a key, this function will inject a key with a '' string value.
12
+ *
13
+ * @param string|array $header Header to parse into components.
14
+ *
15
+ * @return array Returns the parsed header values.
16
+ */
17
+ public static function parse($header)
18
+ {
19
+ static $trimmed = "\"' \n\t\r";
20
+ $params = $matches = [];
21
+
22
+ foreach (self::normalize($header) as $val) {
23
+ $part = [];
24
+ foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
25
+ if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
26
+ $m = $matches[0];
27
+ if (isset($m[1])) {
28
+ $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
29
+ } else {
30
+ $part[] = trim($m[0], $trimmed);
31
+ }
32
+ }
33
+ }
34
+ if ($part) {
35
+ $params[] = $part;
36
+ }
37
+ }
38
+
39
+ return $params;
40
+ }
41
+
42
+ /**
43
+ * Converts an array of header values that may contain comma separated
44
+ * headers into an array of headers with no comma separated values.
45
+ *
46
+ * @param string|array $header Header to normalize.
47
+ *
48
+ * @return array Returns the normalized header field values.
49
+ */
50
+ public static function normalize($header)
51
+ {
52
+ if (!is_array($header)) {
53
+ return array_map('trim', explode(',', $header));
54
+ }
55
+
56
+ $result = [];
57
+ foreach ($header as $value) {
58
+ foreach ((array) $value as $v) {
59
+ if (strpos($v, ',') === false) {
60
+ $result[] = $v;
61
+ continue;
62
+ }
63
+ foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
64
+ $result[] = trim($vv);
65
+ }
66
+ }
67
+ }
68
+
69
+ return $result;
70
+ }
71
+ }
vendor/guzzlehttp/psr7/src/InflateStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
vendor/guzzlehttp/psr7/src/LazyOpenStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -34,6 +35,6 @@ class LazyOpenStream implements StreamInterface
34
  */
35
  protected function createStream()
36
  {
37
- return stream_for(try_fopen($this->filename, $this->mode));
38
  }
39
  }
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
35
  */
36
  protected function createStream()
37
  {
38
+ return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode));
39
  }
40
  }
vendor/guzzlehttp/psr7/src/LimitStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
vendor/guzzlehttp/psr7/src/Message.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace GuzzleHttp\Psr7;
4
+
5
+ use Psr\Http\Message\MessageInterface;
6
+ use Psr\Http\Message\RequestInterface;
7
+ use Psr\Http\Message\ResponseInterface;
8
+
9
+ final class Message
10
+ {
11
+ /**
12
+ * Returns the string representation of an HTTP message.
13
+ *
14
+ * @param MessageInterface $message Message to convert to a string.
15
+ *
16
+ * @return string
17
+ */
18
+ public static function toString(MessageInterface $message)
19
+ {
20
+ if ($message instanceof RequestInterface) {
21
+ $msg = trim($message->getMethod() . ' '
22
+ . $message->getRequestTarget())
23
+ . ' HTTP/' . $message->getProtocolVersion();
24
+ if (!$message->hasHeader('host')) {
25
+ $msg .= "\r\nHost: " . $message->getUri()->getHost();
26
+ }
27
+ } elseif ($message instanceof ResponseInterface) {
28
+ $msg = 'HTTP/' . $message->getProtocolVersion() . ' '
29
+ . $message->getStatusCode() . ' '
30
+ . $message->getReasonPhrase();
31
+ } else {
32
+ throw new \InvalidArgumentException('Unknown message type');
33
+ }
34
+
35
+ foreach ($message->getHeaders() as $name => $values) {
36
+ if (strtolower($name) === 'set-cookie') {
37
+ foreach ($values as $value) {
38
+ $msg .= "\r\n{$name}: " . $value;
39
+ }
40
+ } else {
41
+ $msg .= "\r\n{$name}: " . implode(', ', $values);
42
+ }
43
+ }
44
+
45
+ return "{$msg}\r\n\r\n" . $message->getBody();
46
+ }
47
+
48
+ /**
49
+ * Get a short summary of the message body.
50
+ *
51
+ * Will return `null` if the response is not printable.
52
+ *
53
+ * @param MessageInterface $message The message to get the body summary
54
+ * @param int $truncateAt The maximum allowed size of the summary
55
+ *
56
+ * @return string|null
57
+ */
58
+ public static function bodySummary(MessageInterface $message, $truncateAt = 120)
59
+ {
60
+ $body = $message->getBody();
61
+
62
+ if (!$body->isSeekable() || !$body->isReadable()) {
63
+ return null;
64
+ }
65
+
66
+ $size = $body->getSize();
67
+
68
+ if ($size === 0) {
69
+ return null;
70
+ }
71
+
72
+ $summary = $body->read($truncateAt);
73
+ $body->rewind();
74
+
75
+ if ($size > $truncateAt) {
76
+ $summary .= ' (truncated...)';
77
+ }
78
+
79
+ // Matches any printable character, including unicode characters:
80
+ // letters, marks, numbers, punctuation, spacing, and separators.
81
+ if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) {
82
+ return null;
83
+ }
84
+
85
+ return $summary;
86
+ }
87
+
88
+ /**
89
+ * Attempts to rewind a message body and throws an exception on failure.
90
+ *
91
+ * The body of the message will only be rewound if a call to `tell()`
92
+ * returns a value other than `0`.
93
+ *
94
+ * @param MessageInterface $message Message to rewind
95
+ *
96
+ * @throws \RuntimeException
97
+ */
98
+ public static function rewindBody(MessageInterface $message)
99
+ {
100
+ $body = $message->getBody();
101
+
102
+ if ($body->tell()) {
103
+ $body->rewind();
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Parses an HTTP message into an associative array.
109
+ *
110
+ * The array contains the "start-line" key containing the start line of
111
+ * the message, "headers" key containing an associative array of header
112
+ * array values, and a "body" key containing the body of the message.
113
+ *
114
+ * @param string $message HTTP request or response to parse.
115
+ *
116
+ * @return array
117
+ */
118
+ public static function parseMessage($message)
119
+ {
120
+ if (!$message) {
121
+ throw new \InvalidArgumentException('Invalid message');
122
+ }
123
+
124
+ $message = ltrim($message, "\r\n");
125
+
126
+ $messageParts = preg_split("/\r?\n\r?\n/", $message, 2);
127
+
128
+ if ($messageParts === false || count($messageParts) !== 2) {
129
+ throw new \InvalidArgumentException('Invalid message: Missing header delimiter');
130
+ }
131
+
132
+ list($rawHeaders, $body) = $messageParts;
133
+ $rawHeaders .= "\r\n"; // Put back the delimiter we split previously
134
+ $headerParts = preg_split("/\r?\n/", $rawHeaders, 2);
135
+
136
+ if ($headerParts === false || count($headerParts) !== 2) {
137
+ throw new \InvalidArgumentException('Invalid message: Missing status line');
138
+ }
139
+
140
+ list($startLine, $rawHeaders) = $headerParts;
141
+
142
+ if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') {
143
+ // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0
144
+ $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders);
145
+ }
146
+
147
+ /** @var array[] $headerLines */
148
+ $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER);
149
+
150
+ // If these aren't the same, then one line didn't match and there's an invalid header.
151
+ if ($count !== substr_count($rawHeaders, "\n")) {
152
+ // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4
153
+ if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) {
154
+ throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding');
155
+ }
156
+
157
+ throw new \InvalidArgumentException('Invalid header syntax');
158
+ }
159
+
160
+ $headers = [];
161
+
162
+ foreach ($headerLines as $headerLine) {
163
+ $headers[$headerLine[1]][] = $headerLine[2];
164
+ }
165
+
166
+ return [
167
+ 'start-line' => $startLine,
168
+ 'headers' => $headers,
169
+ 'body' => $body,
170
+ ];
171
+ }
172
+
173
+ /**
174
+ * Constructs a URI for an HTTP request message.
175
+ *
176
+ * @param string $path Path from the start-line
177
+ * @param array $headers Array of headers (each value an array).
178
+ *
179
+ * @return string
180
+ */
181
+ public static function parseRequestUri($path, array $headers)
182
+ {
183
+ $hostKey = array_filter(array_keys($headers), function ($k) {
184
+ return strtolower($k) === 'host';
185
+ });
186
+
187
+ // If no host is found, then a full URI cannot be constructed.
188
+ if (!$hostKey) {
189
+ return $path;
190
+ }
191
+
192
+ $host = $headers[reset($hostKey)][0];
193
+ $scheme = substr($host, -4) === ':443' ? 'https' : 'http';
194
+
195
+ return $scheme . '://' . $host . '/' . ltrim($path, '/');
196
+ }
197
+
198
+ /**
199
+ * Parses a request message string into a request object.
200
+ *
201
+ * @param string $message Request message string.
202
+ *
203
+ * @return Request
204
+ */
205
+ public static function parseRequest($message)
206
+ {
207
+ $data = self::parseMessage($message);
208
+ $matches = [];
209
+ if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) {
210
+ throw new \InvalidArgumentException('Invalid request string');
211
+ }
212
+ $parts = explode(' ', $data['start-line'], 3);
213
+ $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1';
214
+
215
+ $request = new Request(
216
+ $parts[0],
217
+ $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1],
218
+ $data['headers'],
219
+ $data['body'],
220
+ $version
221
+ );
222
+
223
+ return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
224
+ }
225
+
226
+ /**
227
+ * Parses a response message string into a response object.
228
+ *
229
+ * @param string $message Response message string.
230
+ *
231
+ * @return Response
232
+ */
233
+ public static function parseResponse($message)
234
+ {
235
+ $data = self::parseMessage($message);
236
+ // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
237
+ // between status-code and reason-phrase is required. But browsers accept
238
+ // responses without space and reason as well.
239
+ if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
240
+ throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']);
241
+ }
242
+ $parts = explode(' ', $data['start-line'], 3);
243
+
244
+ return new Response(
245
+ (int) $parts[1],
246
+ $data['headers'],
247
+ $data['body'],
248
+ explode('/', $parts[0])[1],
249
+ isset($parts[2]) ? $parts[2] : null
250
+ );
251
+ }
252
+ }
vendor/guzzlehttp/psr7/src/MessageTrait.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -17,7 +18,7 @@ trait MessageTrait
17
  /** @var string */
18
  private $protocol = '1.1';
19
 
20
- /** @var StreamInterface */
21
  private $stream;
22
 
23
  public function getProtocolVersion()
@@ -117,7 +118,7 @@ trait MessageTrait
117
  public function getBody()
118
  {
119
  if (!$this->stream) {
120
- $this->stream = stream_for('');
121
  }
122
 
123
  return $this->stream;
@@ -194,7 +195,7 @@ trait MessageTrait
194
  }
195
 
196
  return trim((string) $value, " \t");
197
- }, $values);
198
  }
199
 
200
  private function assertHeader($header)
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
18
  /** @var string */
19
  private $protocol = '1.1';
20
 
21
+ /** @var StreamInterface|null */
22
  private $stream;
23
 
24
  public function getProtocolVersion()
118
  public function getBody()
119
  {
120
  if (!$this->stream) {
121
+ $this->stream = Utils::streamFor('');
122
  }
123
 
124
  return $this->stream;
195
  }
196
 
197
  return trim((string) $value, " \t");
198
+ }, array_values($values));
199
  }
200
 
201
  private function assertHeader($header)
vendor/guzzlehttp/psr7/src/MimeType.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace GuzzleHttp\Psr7;
4
+
5
+ final class MimeType
6
+ {
7
+ /**
8
+ * Determines the mimetype of a file by looking at its extension.
9
+ *
10
+ * @param string $filename
11
+ *
12
+ * @return string|null
13
+ */
14
+ public static function fromFilename($filename)
15
+ {
16
+ return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
17
+ }
18
+
19
+ /**
20
+ * Maps a file extensions to a mimetype.
21
+ *
22
+ * @param string $extension string The file extension.
23
+ *
24
+ * @return string|null
25
+ *
26
+ * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
27
+ */
28
+ public static function fromExtension($extension)
29
+ {
30
+ static $mimetypes = [
31
+ '3gp' => 'video/3gpp',
32
+ '7z' => 'application/x-7z-compressed',
33
+ 'aac' => 'audio/x-aac',
34
+ 'ai' => 'application/postscript',
35
+ 'aif' => 'audio/x-aiff',
36
+ 'asc' => 'text/plain',
37
+ 'asf' => 'video/x-ms-asf',
38
+ 'atom' => 'application/atom+xml',
39
+ 'avi' => 'video/x-msvideo',
40
+ 'bmp' => 'image/bmp',
41
+ 'bz2' => 'application/x-bzip2',
42
+ 'cer' => 'application/pkix-cert',
43
+ 'crl' => 'application/pkix-crl',
44
+ 'crt' => 'application/x-x509-ca-cert',
45
+ 'css' => 'text/css',
46
+ 'csv' => 'text/csv',
47
+ 'cu' => 'application/cu-seeme',
48
+ 'deb' => 'application/x-debian-package',
49
+ 'doc' => 'application/msword',
50
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
51
+ 'dvi' => 'application/x-dvi',
52
+ 'eot' => 'application/vnd.ms-fontobject',
53
+ 'eps' => 'application/postscript',
54
+ 'epub' => 'application/epub+zip',
55
+ 'etx' => 'text/x-setext',
56
+ 'flac' => 'audio/flac',
57
+ 'flv' => 'video/x-flv',
58
+ 'gif' => 'image/gif',
59
+ 'gz' => 'application/gzip',
60
+ 'htm' => 'text/html',
61
+ 'html' => 'text/html',
62
+ 'ico' => 'image/x-icon',
63
+ 'ics' => 'text/calendar',
64
+ 'ini' => 'text/plain',
65
+ 'iso' => 'application/x-iso9660-image',
66
+ 'jar' => 'application/java-archive',
67
+ 'jpe' => 'image/jpeg',
68
+ 'jpeg' => 'image/jpeg',
69
+ 'jpg' => 'image/jpeg',
70
+ 'js' => 'text/javascript',
71
+ 'json' => 'application/json',
72
+ 'latex' => 'application/x-latex',
73
+ 'log' => 'text/plain',
74
+ 'm4a' => 'audio/mp4',
75
+ 'm4v' => 'video/mp4',
76
+ 'mid' => 'audio/midi',
77
+ 'midi' => 'audio/midi',
78
+ 'mov' => 'video/quicktime',
79
+ 'mkv' => 'video/x-matroska',
80
+ 'mp3' => 'audio/mpeg',
81
+ 'mp4' => 'video/mp4',
82
+ 'mp4a' => 'audio/mp4',
83
+ 'mp4v' => 'video/mp4',
84
+ 'mpe' => 'video/mpeg',
85
+ 'mpeg' => 'video/mpeg',
86
+ 'mpg' => 'video/mpeg',
87
+ 'mpg4' => 'video/mp4',
88
+ 'oga' => 'audio/ogg',
89
+ 'ogg' => 'audio/ogg',
90
+ 'ogv' => 'video/ogg',
91
+ 'ogx' => 'application/ogg',
92
+ 'pbm' => 'image/x-portable-bitmap',
93
+ 'pdf' => 'application/pdf',
94
+ 'pgm' => 'image/x-portable-graymap',
95
+ 'png' => 'image/png',
96
+ 'pnm' => 'image/x-portable-anymap',
97
+ 'ppm' => 'image/x-portable-pixmap',
98
+ 'ppt' => 'application/vnd.ms-powerpoint',
99
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
100
+ 'ps' => 'application/postscript',
101
+ 'qt' => 'video/quicktime',
102
+ 'rar' => 'application/x-rar-compressed',
103
+ 'ras' => 'image/x-cmu-raster',
104
+ 'rss' => 'application/rss+xml',
105
+ 'rtf' => 'application/rtf',
106
+ 'sgm' => 'text/sgml',
107
+ 'sgml' => 'text/sgml',
108
+ 'svg' => 'image/svg+xml',
109
+ 'swf' => 'application/x-shockwave-flash',
110
+ 'tar' => 'application/x-tar',
111
+ 'tif' => 'image/tiff',
112
+ 'tiff' => 'image/tiff',
113
+ 'torrent' => 'application/x-bittorrent',
114
+ 'ttf' => 'application/x-font-ttf',
115
+ 'txt' => 'text/plain',
116
+ 'wav' => 'audio/x-wav',
117
+ 'webm' => 'video/webm',
118
+ 'webp' => 'image/webp',
119
+ 'wma' => 'audio/x-ms-wma',
120
+ 'wmv' => 'video/x-ms-wmv',
121
+ 'woff' => 'application/x-font-woff',
122
+ 'wsdl' => 'application/wsdl+xml',
123
+ 'xbm' => 'image/x-xbitmap',
124
+ 'xls' => 'application/vnd.ms-excel',
125
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
126
+ 'xml' => 'application/xml',
127
+ 'xpm' => 'image/x-xpixmap',
128
+ 'xwd' => 'image/x-xwindowdump',
129
+ 'yaml' => 'text/yaml',
130
+ 'yml' => 'text/yaml',
131
+ 'zip' => 'application/zip',
132
+ ];
133
+
134
+ $extension = strtolower($extension);
135
+
136
+ return isset($mimetypes[$extension])
137
+ ? $mimetypes[$extension]
138
+ : null;
139
+ }
140
+ }
vendor/guzzlehttp/psr7/src/MultipartStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -71,7 +72,7 @@ class MultipartStream implements StreamInterface
71
  }
72
 
73
  // Add the trailing boundary with CRLF
74
- $stream->addStream(stream_for("--{$this->boundary}--\r\n"));
75
 
76
  return $stream;
77
  }
@@ -84,7 +85,7 @@ class MultipartStream implements StreamInterface
84
  }
85
  }
86
 
87
- $element['contents'] = stream_for($element['contents']);
88
 
89
  if (empty($element['filename'])) {
90
  $uri = $element['contents']->getMetadata('uri');
@@ -100,9 +101,9 @@ class MultipartStream implements StreamInterface
100
  isset($element['headers']) ? $element['headers'] : []
101
  );
102
 
103
- $stream->addStream(stream_for($this->getHeaders($headers)));
104
  $stream->addStream($body);
105
- $stream->addStream(stream_for("\r\n"));
106
  }
107
 
108
  /**
@@ -131,7 +132,7 @@ class MultipartStream implements StreamInterface
131
  // Set a default Content-Type if one was not supplied
132
  $type = $this->getHeader($headers, 'content-type');
133
  if (!$type && ($filename === '0' || $filename)) {
134
- if ($type = mimetype_from_filename($filename)) {
135
  $headers['Content-Type'] = $type;
136
  }
137
  }
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
72
  }
73
 
74
  // Add the trailing boundary with CRLF
75
+ $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n"));
76
 
77
  return $stream;
78
  }
85
  }
86
  }
87
 
88
+ $element['contents'] = Utils::streamFor($element['contents']);
89
 
90
  if (empty($element['filename'])) {
91
  $uri = $element['contents']->getMetadata('uri');
101
  isset($element['headers']) ? $element['headers'] : []
102
  );
103
 
104
+ $stream->addStream(Utils::streamFor($this->getHeaders($headers)));
105
  $stream->addStream($body);
106
+ $stream->addStream(Utils::streamFor("\r\n"));
107
  }
108
 
109
  /**
132
  // Set a default Content-Type if one was not supplied
133
  $type = $this->getHeader($headers, 'content-type');
134
  if (!$type && ($filename === '0' || $filename)) {
135
+ if ($type = MimeType::fromFilename($filename)) {
136
  $headers['Content-Type'] = $type;
137
  }
138
  }
vendor/guzzlehttp/psr7/src/NoSeekStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
vendor/guzzlehttp/psr7/src/PumpStream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -51,7 +52,7 @@ class PumpStream implements StreamInterface
51
  public function __toString()
52
  {
53
  try {
54
- return copy_to_string($this);
55
  } catch (\Exception $e) {
56
  return '';
57
  }
@@ -66,6 +67,8 @@ class PumpStream implements StreamInterface
66
  {
67
  $this->tellPos = false;
68
  $this->source = null;
 
 
69
  }
70
 
71
  public function getSize()
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
52
  public function __toString()
53
  {
54
  try {
55
+ return Utils::copyToString($this);
56
  } catch (\Exception $e) {
57
  return '';
58
  }
67
  {
68
  $this->tellPos = false;
69
  $this->source = null;
70
+
71
+ return null;
72
  }
73
 
74
  public function getSize()
vendor/guzzlehttp/psr7/src/Query.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace GuzzleHttp\Psr7;
4
+
5
+ final class Query
6
+ {
7
+ /**
8
+ * Parse a query string into an associative array.
9
+ *
10
+ * If multiple values are found for the same key, the value of that key
11
+ * value pair will become an array. This function does not parse nested
12
+ * PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2`
13
+ * will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`.
14
+ *
15
+ * @param string $str Query string to parse
16
+ * @param int|bool $urlEncoding How the query string is encoded
17
+ *
18
+ * @return array
19
+ */
20
+ public static function parse($str, $urlEncoding = true)
21
+ {
22
+ $result = [];
23
+
24
+ if ($str === '') {
25
+ return $result;
26
+ }
27
+
28
+ if ($urlEncoding === true) {
29
+ $decoder = function ($value) {
30
+ return rawurldecode(str_replace('+', ' ', $value));
31
+ };
32
+ } elseif ($urlEncoding === PHP_QUERY_RFC3986) {
33
+ $decoder = 'rawurldecode';
34
+ } elseif ($urlEncoding === PHP_QUERY_RFC1738) {
35
+ $decoder = 'urldecode';
36
+ } else {
37
+ $decoder = function ($str) { return $str; };
38
+ }
39
+
40
+ foreach (explode('&', $str) as $kvp) {
41
+ $parts = explode('=', $kvp, 2);
42
+ $key = $decoder($parts[0]);
43
+ $value = isset($parts[1]) ? $decoder($parts[1]) : null;
44
+ if (!isset($result[$key])) {
45
+ $result[$key] = $value;
46
+ } else {
47
+ if (!is_array($result[$key])) {
48
+ $result[$key] = [$result[$key]];
49
+ }
50
+ $result[$key][] = $value;
51
+ }
52
+ }
53
+
54
+ return $result;
55
+ }
56
+
57
+ /**
58
+ * Build a query string from an array of key value pairs.
59
+ *
60
+ * This function can use the return value of `parse()` to build a query
61
+ * string. This function does not modify the provided keys when an array is
62
+ * encountered (like `http_build_query()` would).
63
+ *
64
+ * @param array $params Query string parameters.
65
+ * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
66
+ * to encode using RFC3986, or PHP_QUERY_RFC1738
67
+ * to encode using RFC1738.
68
+ * @return string
69
+ */
70
+ public static function build(array $params, $encoding = PHP_QUERY_RFC3986)
71
+ {
72
+ if (!$params) {
73
+ return '';
74
+ }
75
+
76
+ if ($encoding === false) {
77
+ $encoder = function ($str) { return $str; };
78
+ } elseif ($encoding === PHP_QUERY_RFC3986) {
79
+ $encoder = 'rawurlencode';
80
+ } elseif ($encoding === PHP_QUERY_RFC1738) {
81
+ $encoder = 'urlencode';
82
+ } else {
83
+ throw new \InvalidArgumentException('Invalid type');
84
+ }
85
+
86
+ $qs = '';
87
+ foreach ($params as $k => $v) {
88
+ $k = $encoder($k);
89
+ if (!is_array($v)) {
90
+ $qs .= $k;
91
+ if ($v !== null) {
92
+ $qs .= '=' . $encoder($v);
93
+ }
94
+ $qs .= '&';
95
+ } else {
96
+ foreach ($v as $vv) {
97
+ $qs .= $k;
98
+ if ($vv !== null) {
99
+ $qs .= '=' . $encoder($vv);
100
+ }
101
+ $qs .= '&';
102
+ }
103
+ }
104
+ }
105
+
106
+ return $qs ? (string) substr($qs, 0, -1) : '';
107
+ }
108
+ }
vendor/guzzlehttp/psr7/src/Request.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use InvalidArgumentException;
@@ -51,7 +52,7 @@ class Request implements RequestInterface
51
  }
52
 
53
  if ($body !== '' && $body !== null) {
54
- $this->stream = stream_for($body);
55
  }
56
  }
57
 
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use InvalidArgumentException;
52
  }
53
 
54
  if ($body !== '' && $body !== null) {
55
+ $this->stream = Utils::streamFor($body);
56
  }
57
  }
58
 
vendor/guzzlehttp/psr7/src/Response.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\ResponseInterface;
@@ -100,7 +101,7 @@ class Response implements ResponseInterface
100
  $this->statusCode = $status;
101
 
102
  if ($body !== '' && $body !== null) {
103
- $this->stream = stream_for($body);
104
  }
105
 
106
  $this->setHeaders($headers);
@@ -134,7 +135,7 @@ class Response implements ResponseInterface
134
  if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) {
135
  $reasonPhrase = self::$phrases[$new->statusCode];
136
  }
137
- $new->reasonPhrase = $reasonPhrase;
138
  return $new;
139
  }
140
 
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\ResponseInterface;
101
  $this->statusCode = $status;
102
 
103
  if ($body !== '' && $body !== null) {
104
+ $this->stream = Utils::streamFor($body);
105
  }
106
 
107
  $this->setHeaders($headers);
135
  if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) {
136
  $reasonPhrase = self::$phrases[$new->statusCode];
137
  }
138
+ $new->reasonPhrase = (string) $reasonPhrase;
139
  return $new;
140
  }
141
 
vendor/guzzlehttp/psr7/src/ServerRequest.php CHANGED
@@ -79,8 +79,10 @@ class ServerRequest extends Request implements ServerRequestInterface
79
  * Return an UploadedFile instance array.
80
  *
81
  * @param array $files A array which respect $_FILES structure
82
- * @throws InvalidArgumentException for unrecognized values
83
  * @return array
 
 
84
  */
85
  public static function normalizeFiles(array $files)
86
  {
79
  * Return an UploadedFile instance array.
80
  *
81
  * @param array $files A array which respect $_FILES structure
82
+ *
83
  * @return array
84
+ *
85
+ * @throws InvalidArgumentException for unrecognized values
86
  */
87
  public static function normalizeFiles(array $files)
88
  {
vendor/guzzlehttp/psr7/src/Stream.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -76,8 +77,10 @@ class Stream implements StreamInterface
76
  public function __toString()
77
  {
78
  try {
79
- $this->seek(0);
80
- return (string) stream_get_contents($this->stream);
 
 
81
  } catch (\Exception $e) {
82
  return '';
83
  }
@@ -193,7 +196,7 @@ class Stream implements StreamInterface
193
  public function seek($offset, $whence = SEEK_SET)
194
  {
195
  $whence = (int) $whence;
196
-
197
  if (!isset($this->stream)) {
198
  throw new \RuntimeException('Stream is detached');
199
  }
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
77
  public function __toString()
78
  {
79
  try {
80
+ if ($this->isSeekable()) {
81
+ $this->seek(0);
82
+ }
83
+ return $this->getContents();
84
  } catch (\Exception $e) {
85
  return '';
86
  }
196
  public function seek($offset, $whence = SEEK_SET)
197
  {
198
  $whence = (int) $whence;
199
+
200
  if (!isset($this->stream)) {
201
  throw new \RuntimeException('Stream is detached');
202
  }
vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -52,7 +53,7 @@ trait StreamDecoratorTrait
52
 
53
  public function getContents()
54
  {
55
- return copy_to_string($this);
56
  }
57
 
58
  /**
@@ -140,6 +141,7 @@ trait StreamDecoratorTrait
140
  * Implement in subclasses to dynamically create streams when requested.
141
  *
142
  * @return StreamInterface
 
143
  * @throws \BadMethodCallException
144
  */
145
  protected function createStream()
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
53
 
54
  public function getContents()
55
  {
56
+ return Utils::copyToString($this);
57
  }
58
 
59
  /**
141
  * Implement in subclasses to dynamically create streams when requested.
142
  *
143
  * @return StreamInterface
144
+ *
145
  * @throws \BadMethodCallException
146
  */
147
  protected function createStream()
vendor/guzzlehttp/psr7/src/StreamWrapper.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\StreamInterface;
@@ -23,6 +24,7 @@ class StreamWrapper
23
  * @param StreamInterface $stream The stream to get a resource for
24
  *
25
  * @return resource
 
26
  * @throws \InvalidArgumentException if stream is not readable or writable
27
  */
28
  public static function getResource(StreamInterface $stream)
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\StreamInterface;
24
  * @param StreamInterface $stream The stream to get a resource for
25
  *
26
  * @return resource
27
+ *
28
  * @throws \InvalidArgumentException if stream is not readable or writable
29
  */
30
  public static function getResource(StreamInterface $stream)
vendor/guzzlehttp/psr7/src/UploadedFile.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use InvalidArgumentException;
@@ -85,6 +86,7 @@ class UploadedFile implements UploadedFileInterface
85
  * Depending on the value set file or stream variable
86
  *
87
  * @param mixed $streamOrFile
 
88
  * @throws InvalidArgumentException
89
  */
90
  private function setStreamOrFile($streamOrFile)
@@ -104,6 +106,7 @@ class UploadedFile implements UploadedFileInterface
104
 
105
  /**
106
  * @param int $error
 
107
  * @throws InvalidArgumentException
108
  */
109
  private function setError($error)
@@ -125,6 +128,7 @@ class UploadedFile implements UploadedFileInterface
125
 
126
  /**
127
  * @param int $size
 
128
  * @throws InvalidArgumentException
129
  */
130
  private function setSize($size)
@@ -158,6 +162,7 @@ class UploadedFile implements UploadedFileInterface
158
 
159
  /**
160
  * @param string|null $clientFilename
 
161
  * @throws InvalidArgumentException
162
  */
163
  private function setClientFilename($clientFilename)
@@ -173,6 +178,7 @@ class UploadedFile implements UploadedFileInterface
173
 
174
  /**
175
  * @param string|null $clientMediaType
 
176
  * @throws InvalidArgumentException
177
  */
178
  private function setClientMediaType($clientMediaType)
@@ -220,6 +226,7 @@ class UploadedFile implements UploadedFileInterface
220
 
221
  /**
222
  * {@inheritdoc}
 
223
  * @throws RuntimeException if the upload was not successful.
224
  */
225
  public function getStream()
@@ -238,7 +245,9 @@ class UploadedFile implements UploadedFileInterface
238
  *
239
  * @see http://php.net/is_uploaded_file
240
  * @see http://php.net/move_uploaded_file
 
241
  * @param string $targetPath Path to which to move the uploaded file.
 
242
  * @throws RuntimeException if the upload was not successful.
243
  * @throws InvalidArgumentException if the $path specified is invalid.
244
  * @throws RuntimeException on any error during the move operation, or on
@@ -259,7 +268,7 @@ class UploadedFile implements UploadedFileInterface
259
  ? rename($this->file, $targetPath)
260
  : move_uploaded_file($this->file, $targetPath);
261
  } else {
262
- copy_to_stream(
263
  $this->getStream(),
264
  new LazyOpenStream($targetPath, 'w')
265
  );
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use InvalidArgumentException;
86
  * Depending on the value set file or stream variable
87
  *
88
  * @param mixed $streamOrFile
89
+ *
90
  * @throws InvalidArgumentException
91
  */
92
  private function setStreamOrFile($streamOrFile)
106
 
107
  /**
108
  * @param int $error
109
+ *
110
  * @throws InvalidArgumentException
111
  */
112
  private function setError($error)
128
 
129
  /**
130
  * @param int $size
131
+ *
132
  * @throws InvalidArgumentException
133
  */
134
  private function setSize($size)
162
 
163
  /**
164
  * @param string|null $clientFilename
165
+ *
166
  * @throws InvalidArgumentException
167
  */
168
  private function setClientFilename($clientFilename)
178
 
179
  /**
180
  * @param string|null $clientMediaType
181
+ *
182
  * @throws InvalidArgumentException
183
  */
184
  private function setClientMediaType($clientMediaType)
226
 
227
  /**
228
  * {@inheritdoc}
229
+ *
230
  * @throws RuntimeException if the upload was not successful.
231
  */
232
  public function getStream()
245
  *
246
  * @see http://php.net/is_uploaded_file
247
  * @see http://php.net/move_uploaded_file
248
+ *
249
  * @param string $targetPath Path to which to move the uploaded file.
250
+ *
251
  * @throws RuntimeException if the upload was not successful.
252
  * @throws InvalidArgumentException if the $path specified is invalid.
253
  * @throws RuntimeException on any error during the move operation, or on
268
  ? rename($this->file, $targetPath)
269
  : move_uploaded_file($this->file, $targetPath);
270
  } else {
271
+ Utils::copyToStream(
272
  $this->getStream(),
273
  new LazyOpenStream($targetPath, 'w')
274
  );
vendor/guzzlehttp/psr7/src/Uri.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\UriInterface;
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\UriInterface;
vendor/guzzlehttp/psr7/src/UriNormalizer.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\UriInterface;
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\UriInterface;
vendor/guzzlehttp/psr7/src/UriResolver.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\UriInterface;
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\UriInterface;
vendor/guzzlehttp/psr7/src/Utils.php ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace GuzzleHttp\Psr7;
4
+
5
+ use Psr\Http\Message\RequestInterface;
6
+ use Psr\Http\Message\ServerRequestInterface;
7
+ use Psr\Http\Message\StreamInterface;
8
+ use Psr\Http\Message\UriInterface;
9
+
10
+ final class Utils
11
+ {
12
+ /**
13
+ * Remove the items given by the keys, case insensitively from the data.
14
+ *
15
+ * @param iterable<string> $keys
16
+ *
17
+ * @return array
18
+ */
19
+ public static function caselessRemove($keys, array $data)
20
+ {
21
+ $result = [];
22
+
23
+ foreach ($keys as &$key) {
24
+ $key = strtolower($key);
25
+ }
26
+
27
+ foreach ($data as $k => $v) {
28
+ if (!in_array(strtolower($k), $keys)) {
29
+ $result[$k] = $v;
30
+ }
31
+ }
32
+
33
+ return $result;
34
+ }
35
+
36
+ /**
37
+ * Copy the contents of a stream into another stream until the given number
38
+ * of bytes have been read.
39
+ *
40
+ * @param StreamInterface $source Stream to read from
41
+ * @param StreamInterface $dest Stream to write to
42
+ * @param int $maxLen Maximum number of bytes to read. Pass -1
43
+ * to read the entire stream.
44
+ *
45
+ * @throws \RuntimeException on error.
46
+ */
47
+ public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)
48
+ {
49
+ $bufferSize = 8192;
50
+
51
+ if ($maxLen === -1) {
52
+ while (!$source->eof()) {
53
+ if (!$dest->write($source->read($bufferSize))) {
54
+ break;
55
+ }
56
+ }
57
+ } else {
58
+ $remaining = $maxLen;
59
+ while ($remaining > 0 && !$source->eof()) {
60
+ $buf = $source->read(min($bufferSize, $remaining));
61
+ $len = strlen($buf);
62
+ if (!$len) {
63
+ break;
64
+ }
65
+ $remaining -= $len;
66
+ $dest->write($buf);
67
+ }
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Copy the contents of a stream into a string until the given number of
73
+ * bytes have been read.
74
+ *
75
+ * @param StreamInterface $stream Stream to read
76
+ * @param int $maxLen Maximum number of bytes to read. Pass -1
77
+ * to read the entire stream.
78
+ * @return string
79
+ *
80
+ * @throws \RuntimeException on error.
81
+ */
82
+ public static function copyToString(StreamInterface $stream, $maxLen = -1)
83
+ {
84
+ $buffer = '';
85
+
86
+ if ($maxLen === -1) {
87
+ while (!$stream->eof()) {
88
+ $buf = $stream->read(1048576);
89
+ // Using a loose equality here to match on '' and false.
90
+ if ($buf == null) {
91
+ break;
92
+ }
93
+ $buffer .= $buf;
94
+ }
95
+ return $buffer;
96
+ }
97
+
98
+ $len = 0;
99
+ while (!$stream->eof() && $len < $maxLen) {
100
+ $buf = $stream->read($maxLen - $len);
101
+ // Using a loose equality here to match on '' and false.
102
+ if ($buf == null) {
103
+ break;
104
+ }
105
+ $buffer .= $buf;
106
+ $len = strlen($buffer);
107
+ }
108
+
109
+ return $buffer;
110
+ }
111
+
112
+ /**
113
+ * Calculate a hash of a stream.
114
+ *
115
+ * This method reads the entire stream to calculate a rolling hash, based
116
+ * on PHP's `hash_init` functions.
117
+ *
118
+ * @param StreamInterface $stream Stream to calculate the hash for
119
+ * @param string $algo Hash algorithm (e.g. md5, crc32, etc)
120
+ * @param bool $rawOutput Whether or not to use raw output
121
+ *
122
+ * @return string Returns the hash of the stream
123
+ *
124
+ * @throws \RuntimeException on error.
125
+ */
126
+ public static function hash(StreamInterface $stream, $algo, $rawOutput = false)
127
+ {
128
+ $pos = $stream->tell();
129
+
130
+ if ($pos > 0) {
131
+ $stream->rewind();
132
+ }
133
+
134
+ $ctx = hash_init($algo);
135
+ while (!$stream->eof()) {
136
+ hash_update($ctx, $stream->read(1048576));
137
+ }
138
+
139
+ $out = hash_final($ctx, (bool) $rawOutput);
140
+ $stream->seek($pos);
141
+
142
+ return $out;
143
+ }
144
+
145
+ /**
146
+ * Clone and modify a request with the given changes.
147
+ *
148
+ * This method is useful for reducing the number of clones needed to mutate
149
+ * a message.
150
+ *
151
+ * The changes can be one of:
152
+ * - method: (string) Changes the HTTP method.
153
+ * - set_headers: (array) Sets the given headers.
154
+ * - remove_headers: (array) Remove the given headers.
155
+ * - body: (mixed) Sets the given body.
156
+ * - uri: (UriInterface) Set the URI.
157
+ * - query: (string) Set the query string value of the URI.
158
+ * - version: (string) Set the protocol version.
159
+ *
160
+ * @param RequestInterface $request Request to clone and modify.
161
+ * @param array $changes Changes to apply.
162
+ *
163
+ * @return RequestInterface
164
+ */
165
+ public static function modifyRequest(RequestInterface $request, array $changes)
166
+ {
167
+ if (!$changes) {
168
+ return $request;
169
+ }
170
+
171
+ $headers = $request->getHeaders();
172
+
173
+ if (!isset($changes['uri'])) {
174
+ $uri = $request->getUri();
175
+ } else {
176
+ // Remove the host header if one is on the URI
177
+ if ($host = $changes['uri']->getHost()) {
178
+ $changes['set_headers']['Host'] = $host;
179
+
180
+ if ($port = $changes['uri']->getPort()) {
181
+ $standardPorts = ['http' => 80, 'https' => 443];
182
+ $scheme = $changes['uri']->getScheme();
183
+ if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
184
+ $changes['set_headers']['Host'] .= ':'.$port;
185
+ }
186
+ }
187
+ }
188
+ $uri = $changes['uri'];
189
+ }
190
+
191
+ if (!empty($changes['remove_headers'])) {
192
+ $headers = self::caselessRemove($changes['remove_headers'], $headers);
193
+ }
194
+
195
+ if (!empty($changes['set_headers'])) {
196
+ $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers);
197
+ $headers = $changes['set_headers'] + $headers;
198
+ }
199
+
200
+ if (isset($changes['query'])) {
201
+ $uri = $uri->withQuery($changes['query']);
202
+ }
203
+
204
+ if ($request instanceof ServerRequestInterface) {
205
+ return (new ServerRequest(
206
+ isset($changes['method']) ? $changes['method'] : $request->getMethod(),
207
+ $uri,
208
+ $headers,
209
+ isset($changes['body']) ? $changes['body'] : $request->getBody(),
210
+ isset($changes['version'])
211
+ ? $changes['version']
212
+ : $request->getProtocolVersion(),
213
+ $request->getServerParams()
214
+ ))
215
+ ->withParsedBody($request->getParsedBody())
216
+ ->withQueryParams($request->getQueryParams())
217
+ ->withCookieParams($request->getCookieParams())
218
+ ->withUploadedFiles($request->getUploadedFiles());
219
+ }
220
+
221
+ return new Request(
222
+ isset($changes['method']) ? $changes['method'] : $request->getMethod(),
223
+ $uri,
224
+ $headers,
225
+ isset($changes['body']) ? $changes['body'] : $request->getBody(),
226
+ isset($changes['version'])
227
+ ? $changes['version']
228
+ : $request->getProtocolVersion()
229
+ );
230
+ }
231
+
232
+ /**
233
+ * Read a line from the stream up to the maximum allowed buffer length.
234
+ *
235
+ * @param StreamInterface $stream Stream to read from
236
+ * @param int|null $maxLength Maximum buffer length
237
+ *
238
+ * @return string
239
+ */
240
+ public static function readLine(StreamInterface $stream, $maxLength = null)
241
+ {
242
+ $buffer = '';
243
+ $size = 0;
244
+
245
+ while (!$stream->eof()) {
246
+ // Using a loose equality here to match on '' and false.
247
+ if (null == ($byte = $stream->read(1))) {
248
+ return $buffer;
249
+ }
250
+ $buffer .= $byte;
251
+ // Break when a new line is found or the max length - 1 is reached
252
+ if ($byte === "\n" || ++$size === $maxLength - 1) {
253
+ break;
254
+ }
255
+ }
256
+
257
+ return $buffer;
258
+ }
259
+
260
+ /**
261
+ * Create a new stream based on the input type.
262
+ *
263
+ * Options is an associative array that can contain the following keys:
264
+ * - metadata: Array of custom metadata.
265
+ * - size: Size of the stream.
266
+ *
267
+ * This method accepts the following `$resource` types:
268
+ * - `Psr\Http\Message\StreamInterface`: Returns the value as-is.
269
+ * - `string`: Creates a stream object that uses the given string as the contents.
270
+ * - `resource`: Creates a stream object that wraps the given PHP stream resource.
271
+ * - `Iterator`: If the provided value implements `Iterator`, then a read-only
272
+ * stream object will be created that wraps the given iterable. Each time the
273
+ * stream is read from, data from the iterator will fill a buffer and will be
274
+ * continuously called until the buffer is equal to the requested read size.
275
+ * Subsequent read calls will first read from the buffer and then call `next`
276
+ * on the underlying iterator until it is exhausted.
277
+ * - `object` with `__toString()`: If the object has the `__toString()` method,
278
+ * the object will be cast to a string and then a stream will be returned that
279
+ * uses the string value.
280
+ * - `NULL`: When `null` is passed, an empty stream object is returned.
281
+ * - `callable` When a callable is passed, a read-only stream object will be
282
+ * created that invokes the given callable. The callable is invoked with the
283
+ * number of suggested bytes to read. The callable can return any number of
284
+ * bytes, but MUST return `false` when there is no more data to return. The
285
+ * stream object that wraps the callable will invoke the callable until the
286
+ * number of requested bytes are available. Any additional bytes will be
287
+ * buffered and used in subsequent reads.
288
+ *
289
+ * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data
290
+ * @param array $options Additional options
291
+ *
292
+ * @return StreamInterface
293
+ *
294
+ * @throws \InvalidArgumentException if the $resource arg is not valid.
295
+ */
296
+ public static function streamFor($resource = '', array $options = [])
297
+ {
298
+ if (is_scalar($resource)) {
299
+ $stream = fopen('php://temp', 'r+');
300
+ if ($resource !== '') {
301
+ fwrite($stream, $resource);
302
+ fseek($stream, 0);
303
+ }
304
+ return new Stream($stream, $options);
305
+ }
306
+
307
+ switch (gettype($resource)) {
308
+ case 'resource':
309
+ return new Stream($resource, $options);
310
+ case 'object':
311
+ if ($resource instanceof StreamInterface) {
312
+ return $resource;
313
+ } elseif ($resource instanceof \Iterator) {
314
+ return new PumpStream(function () use ($resource) {
315
+ if (!$resource->valid()) {
316
+ return false;
317
+ }
318
+ $result = $resource->current();
319
+ $resource->next();
320
+ return $result;
321
+ }, $options);
322
+ } elseif (method_exists($resource, '__toString')) {
323
+ return Utils::streamFor((string) $resource, $options);
324
+ }
325
+ break;
326
+ case 'NULL':
327
+ return new Stream(fopen('php://temp', 'r+'), $options);
328
+ }
329
+
330
+ if (is_callable($resource)) {
331
+ return new PumpStream($resource, $options);
332
+ }
333
+
334
+ throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
335
+ }
336
+
337
+ /**
338
+ * Safely opens a PHP stream resource using a filename.
339
+ *
340
+ * When fopen fails, PHP normally raises a warning. This function adds an
341
+ * error handler that checks for errors and throws an exception instead.
342
+ *
343
+ * @param string $filename File to open
344
+ * @param string $mode Mode used to open the file
345
+ *
346
+ * @return resource
347
+ *
348
+ * @throws \RuntimeException if the file cannot be opened
349
+ */
350
+ public static function tryFopen($filename, $mode)
351
+ {
352
+ $ex = null;
353
+ set_error_handler(function () use ($filename, $mode, &$ex) {
354
+ $ex = new \RuntimeException(sprintf(
355
+ 'Unable to open %s using mode %s: %s',
356
+ $filename,
357
+ $mode,
358
+ func_get_args()[1]
359
+ ));
360
+ });
361
+
362
+ $handle = fopen($filename, $mode);
363
+ restore_error_handler();
364
+
365
+ if ($ex) {
366
+ /** @var $ex \RuntimeException */
367
+ throw $ex;
368
+ }
369
+
370
+ return $handle;
371
+ }
372
+
373
+ /**
374
+ * Returns a UriInterface for the given value.
375
+ *
376
+ * This function accepts a string or UriInterface and returns a
377
+ * UriInterface for the given value. If the value is already a
378
+ * UriInterface, it is returned as-is.
379
+ *
380
+ * @param string|UriInterface $uri
381
+ *
382
+ * @return UriInterface
383
+ *
384
+ * @throws \InvalidArgumentException
385
+ */
386
+ public static function uriFor($uri)
387
+ {
388
+ if ($uri instanceof UriInterface) {
389
+ return $uri;
390
+ }
391
+
392
+ if (is_string($uri)) {
393
+ return new Uri($uri);
394
+ }
395
+
396
+ throw new \InvalidArgumentException('URI must be a string or UriInterface');
397
+ }
398
+ }
vendor/guzzlehttp/psr7/src/functions.php CHANGED
@@ -1,10 +1,9 @@
1
  <?php
 
2
  namespace GuzzleHttp\Psr7;
3
 
4
  use Psr\Http\Message\MessageInterface;
5
  use Psr\Http\Message\RequestInterface;
6
- use Psr\Http\Message\ResponseInterface;
7
- use Psr\Http\Message\ServerRequestInterface;
8
  use Psr\Http\Message\StreamInterface;
9
  use Psr\Http\Message\UriInterface;
10
 
@@ -14,52 +13,32 @@ use Psr\Http\Message\UriInterface;
14
  * @param MessageInterface $message Message to convert to a string.
15
  *
16
  * @return string
 
 
17
  */
18
  function str(MessageInterface $message)
19
  {
20
- if ($message instanceof RequestInterface) {
21
- $msg = trim($message->getMethod() . ' '
22
- . $message->getRequestTarget())
23
- . ' HTTP/' . $message->getProtocolVersion();
24
- if (!$message->hasHeader('host')) {
25
- $msg .= "\r\nHost: " . $message->getUri()->getHost();
26
- }
27
- } elseif ($message instanceof ResponseInterface) {
28
- $msg = 'HTTP/' . $message->getProtocolVersion() . ' '
29
- . $message->getStatusCode() . ' '
30
- . $message->getReasonPhrase();
31
- } else {
32
- throw new \InvalidArgumentException('Unknown message type');
33
- }
34
-
35
- foreach ($message->getHeaders() as $name => $values) {
36
- $msg .= "\r\n{$name}: " . implode(', ', $values);
37
- }
38
-
39
- return "{$msg}\r\n\r\n" . $message->getBody();
40
  }
41
 
42
  /**
43
  * Returns a UriInterface for the given value.
44
  *
45
- * This function accepts a string or {@see Psr\Http\Message\UriInterface} and
46
- * returns a UriInterface for the given value. If the value is already a
47
- * `UriInterface`, it is returned as-is.
48
  *
49
  * @param string|UriInterface $uri
50
  *
51
  * @return UriInterface
 
52
  * @throws \InvalidArgumentException
 
 
53
  */
54
  function uri_for($uri)
55
  {
56
- if ($uri instanceof UriInterface) {
57
- return $uri;
58
- } elseif (is_string($uri)) {
59
- return new Uri($uri);
60
- }
61
-
62
- throw new \InvalidArgumentException('URI must be a string or UriInterface');
63
  }
64
 
65
  /**
@@ -69,86 +48,57 @@ function uri_for($uri)
69
  * - metadata: Array of custom metadata.
70
  * - size: Size of the stream.
71
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data
73
  * @param array $options Additional options
74
  *
75
  * @return StreamInterface
 
76
  * @throws \InvalidArgumentException if the $resource arg is not valid.
 
 
77
  */
78
  function stream_for($resource = '', array $options = [])
79
  {
80
- if (is_scalar($resource)) {
81
- $stream = fopen('php://temp', 'r+');
82
- if ($resource !== '') {
83
- fwrite($stream, $resource);
84
- fseek($stream, 0);
85
- }
86
- return new Stream($stream, $options);
87
- }
88
-
89
- switch (gettype($resource)) {
90
- case 'resource':
91
- return new Stream($resource, $options);
92
- case 'object':
93
- if ($resource instanceof StreamInterface) {
94
- return $resource;
95
- } elseif ($resource instanceof \Iterator) {
96
- return new PumpStream(function () use ($resource) {
97
- if (!$resource->valid()) {
98
- return false;
99
- }
100
- $result = $resource->current();
101
- $resource->next();
102
- return $result;
103
- }, $options);
104
- } elseif (method_exists($resource, '__toString')) {
105
- return stream_for((string) $resource, $options);
106
- }
107
- break;
108
- case 'NULL':
109
- return new Stream(fopen('php://temp', 'r+'), $options);
110
- }
111
-
112
- if (is_callable($resource)) {
113
- return new PumpStream($resource, $options);
114
- }
115
-
116
- throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
117
  }
118
 
119
  /**
120
  * Parse an array of header values containing ";" separated data into an
121
- * array of associative arrays representing the header key value pair
122
- * data of the header. When a parameter does not contain a value, but just
123
  * contains a key, this function will inject a key with a '' string value.
124
  *
125
  * @param string|array $header Header to parse into components.
126
  *
127
  * @return array Returns the parsed header values.
 
 
128
  */
129
  function parse_header($header)
130
  {
131
- static $trimmed = "\"' \n\t\r";
132
- $params = $matches = [];
133
-
134
- foreach (normalize_header($header) as $val) {
135
- $part = [];
136
- foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
137
- if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
138
- $m = $matches[0];
139
- if (isset($m[1])) {
140
- $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
141
- } else {
142
- $part[] = trim($m[0], $trimmed);
143
- }
144
- }
145
- }
146
- if ($part) {
147
- $params[] = $part;
148
- }
149
- }
150
-
151
- return $params;
152
  }
153
 
154
  /**
@@ -158,32 +108,20 @@ function parse_header($header)
158
  * @param string|array $header Header to normalize.
159
  *
160
  * @return array Returns the normalized header field values.
 
 
161
  */
162
  function normalize_header($header)
163
  {
164
- if (!is_array($header)) {
165
- return array_map('trim', explode(',', $header));
166
- }
167
-
168
- $result = [];
169
- foreach ($header as $value) {
170
- foreach ((array) $value as $v) {
171
- if (strpos($v, ',') === false) {
172
- $result[] = $v;
173
- continue;
174
- }
175
- foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
176
- $result[] = trim($vv);
177
- }
178
- }
179
- }
180
-
181
- return $result;
182
  }
183
 
184
  /**
185
  * Clone and modify a request with the given changes.
186
  *
 
 
 
187
  * The changes can be one of:
188
  * - method: (string) Changes the HTTP method.
189
  * - set_headers: (array) Sets the given headers.
@@ -197,72 +135,12 @@ function normalize_header($header)
197
  * @param array $changes Changes to apply.
198
  *
199
  * @return RequestInterface
 
 
200
  */
201
  function modify_request(RequestInterface $request, array $changes)
202
  {
203
- if (!$changes) {
204
- return $request;
205
- }
206
-
207
- $headers = $request->getHeaders();
208
-
209
- if (!isset($changes['uri'])) {
210
- $uri = $request->getUri();
211
- } else {
212
- // Remove the host header if one is on the URI
213
- if ($host = $changes['uri']->getHost()) {
214
- $changes['set_headers']['Host'] = $host;
215
-
216
- if ($port = $changes['uri']->getPort()) {
217
- $standardPorts = ['http' => 80, 'https' => 443];
218
- $scheme = $changes['uri']->getScheme();
219
- if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
220
- $changes['set_headers']['Host'] .= ':'.$port;
221
- }
222
- }
223
- }
224
- $uri = $changes['uri'];
225
- }
226
-
227
- if (!empty($changes['remove_headers'])) {
228
- $headers = _caseless_remove($changes['remove_headers'], $headers);
229
- }
230
-
231
- if (!empty($changes['set_headers'])) {
232
- $headers = _caseless_remove(array_keys($changes['set_headers']), $headers);
233
- $headers = $changes['set_headers'] + $headers;
234
- }
235
-
236
- if (isset($changes['query'])) {
237
- $uri = $uri->withQuery($changes['query']);
238
- }
239
-
240
- if ($request instanceof ServerRequestInterface) {
241
- return (new ServerRequest(
242
- isset($changes['method']) ? $changes['method'] : $request->getMethod(),
243
- $uri,
244
- $headers,
245
- isset($changes['body']) ? $changes['body'] : $request->getBody(),
246
- isset($changes['version'])
247
- ? $changes['version']
248
- : $request->getProtocolVersion(),
249
- $request->getServerParams()
250
- ))
251
- ->withParsedBody($request->getParsedBody())
252
- ->withQueryParams($request->getQueryParams())
253
- ->withCookieParams($request->getCookieParams())
254
- ->withUploadedFiles($request->getUploadedFiles());
255
- }
256
-
257
- return new Request(
258
- isset($changes['method']) ? $changes['method'] : $request->getMethod(),
259
- $uri,
260
- $headers,
261
- isset($changes['body']) ? $changes['body'] : $request->getBody(),
262
- isset($changes['version'])
263
- ? $changes['version']
264
- : $request->getProtocolVersion()
265
- );
266
  }
267
 
268
  /**
@@ -274,14 +152,12 @@ function modify_request(RequestInterface $request, array $changes)
274
  * @param MessageInterface $message Message to rewind
275
  *
276
  * @throws \RuntimeException
 
 
277
  */
278
  function rewind_body(MessageInterface $message)
279
  {
280
- $body = $message->getBody();
281
-
282
- if ($body->tell()) {
283
- $body->rewind();
284
- }
285
  }
286
 
287
  /**
@@ -294,29 +170,14 @@ function rewind_body(MessageInterface $message)
294
  * @param string $mode Mode used to open the file
295
  *
296
  * @return resource
 
297
  * @throws \RuntimeException if the file cannot be opened
 
 
298
  */
299
  function try_fopen($filename, $mode)
300
  {
301
- $ex = null;
302
- set_error_handler(function () use ($filename, $mode, &$ex) {
303
- $ex = new \RuntimeException(sprintf(
304
- 'Unable to open %s using mode %s: %s',
305
- $filename,
306
- $mode,
307
- func_get_args()[1]
308
- ));
309
- });
310
-
311
- $handle = fopen($filename, $mode);
312
- restore_error_handler();
313
-
314
- if ($ex) {
315
- /** @var $ex \RuntimeException */
316
- throw $ex;
317
- }
318
-
319
- return $handle;
320
  }
321
 
322
  /**
@@ -327,36 +188,14 @@ function try_fopen($filename, $mode)
327
  * @param int $maxLen Maximum number of bytes to read. Pass -1
328
  * to read the entire stream.
329
  * @return string
 
330
  * @throws \RuntimeException on error.
 
 
331
  */
332
  function copy_to_string(StreamInterface $stream, $maxLen = -1)
333
  {
334
- $buffer = '';
335
-
336
- if ($maxLen === -1) {
337
- while (!$stream->eof()) {
338
- $buf = $stream->read(1048576);
339
- // Using a loose equality here to match on '' and false.
340
- if ($buf == null) {
341
- break;
342
- }
343
- $buffer .= $buf;
344
- }
345
- return $buffer;
346
- }
347
-
348
- $len = 0;
349
- while (!$stream->eof() && $len < $maxLen) {
350
- $buf = $stream->read($maxLen - $len);
351
- // Using a loose equality here to match on '' and false.
352
- if ($buf == null) {
353
- break;
354
- }
355
- $buffer .= $buf;
356
- $len = strlen($buffer);
357
- }
358
-
359
- return $buffer;
360
  }
361
 
362
  /**
@@ -369,92 +208,48 @@ function copy_to_string(StreamInterface $stream, $maxLen = -1)
369
  * to read the entire stream.
370
  *
371
  * @throws \RuntimeException on error.
 
 
372
  */
373
- function copy_to_stream(
374
- StreamInterface $source,
375
- StreamInterface $dest,
376
- $maxLen = -1
377
- ) {
378
- $bufferSize = 8192;
379
-
380
- if ($maxLen === -1) {
381
- while (!$source->eof()) {
382
- if (!$dest->write($source->read($bufferSize))) {
383
- break;
384
- }
385
- }
386
- } else {
387
- $remaining = $maxLen;
388
- while ($remaining > 0 && !$source->eof()) {
389
- $buf = $source->read(min($bufferSize, $remaining));
390
- $len = strlen($buf);
391
- if (!$len) {
392
- break;
393
- }
394
- $remaining -= $len;
395
- $dest->write($buf);
396
- }
397
- }
398
  }
399
 
400
  /**
401
- * Calculate a hash of a Stream
 
 
 
402
  *
403
  * @param StreamInterface $stream Stream to calculate the hash for
404
  * @param string $algo Hash algorithm (e.g. md5, crc32, etc)
405
  * @param bool $rawOutput Whether or not to use raw output
406
  *
407
  * @return string Returns the hash of the stream
 
408
  * @throws \RuntimeException on error.
 
 
409
  */
410
- function hash(
411
- StreamInterface $stream,
412
- $algo,
413
- $rawOutput = false
414
- ) {
415
- $pos = $stream->tell();
416
-
417
- if ($pos > 0) {
418
- $stream->rewind();
419
- }
420
-
421
- $ctx = hash_init($algo);
422
- while (!$stream->eof()) {
423
- hash_update($ctx, $stream->read(1048576));
424
- }
425
-
426
- $out = hash_final($ctx, (bool) $rawOutput);
427
- $stream->seek($pos);
428
-
429
- return $out;
430
  }
431
 
432
  /**
433
- * Read a line from the stream up to the maximum allowed buffer length
434
  *
435
  * @param StreamInterface $stream Stream to read from
436
- * @param int $maxLength Maximum buffer length
437
  *
438
  * @return string
 
 
439
  */
440
  function readline(StreamInterface $stream, $maxLength = null)
441
  {
442
- $buffer = '';
443
- $size = 0;
444
-
445
- while (!$stream->eof()) {
446
- // Using a loose equality here to match on '' and false.
447
- if (null == ($byte = $stream->read(1))) {
448
- return $buffer;
449
- }
450
- $buffer .= $byte;
451
- // Break when a new line is found or the max length - 1 is reached
452
- if ($byte === "\n" || ++$size === $maxLength - 1) {
453
- break;
454
- }
455
- }
456
-
457
- return $buffer;
458
  }
459
 
460
  /**
@@ -463,26 +258,12 @@ function readline(StreamInterface $stream, $maxLength = null)
463
  * @param string $message Request message string.
464
  *
465
  * @return Request
 
 
466
  */
467
  function parse_request($message)
468
  {
469
- $data = _parse_message($message);
470
- $matches = [];
471
- if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) {
472
- throw new \InvalidArgumentException('Invalid request string');
473
- }
474
- $parts = explode(' ', $data['start-line'], 3);
475
- $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1';
476
-
477
- $request = new Request(
478
- $parts[0],
479
- $matches[1] === '/' ? _parse_request_uri($parts[1], $data['headers']) : $parts[1],
480
- $data['headers'],
481
- $data['body'],
482
- $version
483
- );
484
-
485
- return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
486
  }
487
 
488
  /**
@@ -491,139 +272,66 @@ function parse_request($message)
491
  * @param string $message Response message string.
492
  *
493
  * @return Response
 
 
494
  */
495
  function parse_response($message)
496
  {
497
- $data = _parse_message($message);
498
- // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
499
- // between status-code and reason-phrase is required. But browsers accept
500
- // responses without space and reason as well.
501
- if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
502
- throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']);
503
- }
504
- $parts = explode(' ', $data['start-line'], 3);
505
-
506
- return new Response(
507
- $parts[1],
508
- $data['headers'],
509
- $data['body'],
510
- explode('/', $parts[0])[1],
511
- isset($parts[2]) ? $parts[2] : null
512
- );
513
  }
514
 
515
  /**
516
  * Parse a query string into an associative array.
517
  *
518
- * If multiple values are found for the same key, the value of that key
519
- * value pair will become an array. This function does not parse nested
520
- * PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will
521
- * be parsed into ['foo[a]' => '1', 'foo[b]' => '2']).
522
  *
523
  * @param string $str Query string to parse
524
  * @param int|bool $urlEncoding How the query string is encoded
525
  *
526
  * @return array
 
 
527
  */
528
  function parse_query($str, $urlEncoding = true)
529
  {
530
- $result = [];
531
-
532
- if ($str === '') {
533
- return $result;
534
- }
535
-
536
- if ($urlEncoding === true) {
537
- $decoder = function ($value) {
538
- return rawurldecode(str_replace('+', ' ', $value));
539
- };
540
- } elseif ($urlEncoding === PHP_QUERY_RFC3986) {
541
- $decoder = 'rawurldecode';
542
- } elseif ($urlEncoding === PHP_QUERY_RFC1738) {
543
- $decoder = 'urldecode';
544
- } else {
545
- $decoder = function ($str) { return $str; };
546
- }
547
-
548
- foreach (explode('&', $str) as $kvp) {
549
- $parts = explode('=', $kvp, 2);
550
- $key = $decoder($parts[0]);
551
- $value = isset($parts[1]) ? $decoder($parts[1]) : null;
552
- if (!isset($result[$key])) {
553
- $result[$key] = $value;
554
- } else {
555
- if (!is_array($result[$key])) {
556
- $result[$key] = [$result[$key]];
557
- }
558
- $result[$key][] = $value;
559
- }
560
- }
561
-
562
- return $result;
563
  }
564
 
565
  /**
566
  * Build a query string from an array of key value pairs.
567
  *
568
- * This function can use the return value of parse_query() to build a query
569
  * string. This function does not modify the provided keys when an array is
570
- * encountered (like http_build_query would).
571
  *
572
  * @param array $params Query string parameters.
573
  * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
574
  * to encode using RFC3986, or PHP_QUERY_RFC1738
575
  * to encode using RFC1738.
576
  * @return string
 
 
577
  */
578
  function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
579
  {
580
- if (!$params) {
581
- return '';
582
- }
583
-
584
- if ($encoding === false) {
585
- $encoder = function ($str) { return $str; };
586
- } elseif ($encoding === PHP_QUERY_RFC3986) {
587
- $encoder = 'rawurlencode';
588
- } elseif ($encoding === PHP_QUERY_RFC1738) {
589
- $encoder = 'urlencode';
590
- } else {
591
- throw new \InvalidArgumentException('Invalid type');
592
- }
593
-
594
- $qs = '';
595
- foreach ($params as $k => $v) {
596
- $k = $encoder($k);
597
- if (!is_array($v)) {
598
- $qs .= $k;
599
- if ($v !== null) {
600
- $qs .= '=' . $encoder($v);
601
- }
602
- $qs .= '&';
603
- } else {
604
- foreach ($v as $vv) {
605
- $qs .= $k;
606
- if ($vv !== null) {
607
- $qs .= '=' . $encoder($vv);
608
- }
609
- $qs .= '&';
610
- }
611
- }
612
- }
613
-
614
- return $qs ? (string) substr($qs, 0, -1) : '';
615
  }
616
 
617
  /**
618
  * Determines the mimetype of a file by looking at its extension.
619
  *
620
- * @param $filename
 
 
621
  *
622
- * @return null|string
623
  */
624
  function mimetype_from_filename($filename)
625
  {
626
- return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION));
627
  }
628
 
629
  /**
@@ -632,119 +340,13 @@ function mimetype_from_filename($filename)
632
  * @param $extension string The file extension.
633
  *
634
  * @return string|null
 
635
  * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
 
636
  */
637
  function mimetype_from_extension($extension)
638
  {
639
- static $mimetypes = [
640
- '3gp' => 'video/3gpp',
641
- '7z' => 'application/x-7z-compressed',
642
- 'aac' => 'audio/x-aac',
643
- 'ai' => 'application/postscript',
644
- 'aif' => 'audio/x-aiff',
645
- 'asc' => 'text/plain',
646
- 'asf' => 'video/x-ms-asf',
647
- 'atom' => 'application/atom+xml',
648
- 'avi' => 'video/x-msvideo',
649
- 'bmp' => 'image/bmp',
650
- 'bz2' => 'application/x-bzip2',
651
- 'cer' => 'application/pkix-cert',
652
- 'crl' => 'application/pkix-crl',
653
- 'crt' => 'application/x-x509-ca-cert',
654
- 'css' => 'text/css',
655
- 'csv' => 'text/csv',
656
- 'cu' => 'application/cu-seeme',
657
- 'deb' => 'application/x-debian-package',
658
- 'doc' => 'application/msword',
659
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
660
- 'dvi' => 'application/x-dvi',
661
- 'eot' => 'application/vnd.ms-fontobject',
662
- 'eps' => 'application/postscript',
663
- 'epub' => 'application/epub+zip',
664
- 'etx' => 'text/x-setext',
665
- 'flac' => 'audio/flac',
666
- 'flv' => 'video/x-flv',
667
- 'gif' => 'image/gif',
668
- 'gz' => 'application/gzip',
669
- 'htm' => 'text/html',
670
- 'html' => 'text/html',
671
- 'ico' => 'image/x-icon',
672
- 'ics' => 'text/calendar',
673
- 'ini' => 'text/plain',
674
- 'iso' => 'application/x-iso9660-image',
675
- 'jar' => 'application/java-archive',
676
- 'jpe' => 'image/jpeg',
677
- 'jpeg' => 'image/jpeg',
678
- 'jpg' => 'image/jpeg',
679
- 'js' => 'text/javascript',
680
- 'json' => 'application/json',
681
- 'latex' => 'application/x-latex',
682
- 'log' => 'text/plain',
683
- 'm4a' => 'audio/mp4',
684
- 'm4v' => 'video/mp4',
685
- 'mid' => 'audio/midi',
686
- 'midi' => 'audio/midi',
687
- 'mov' => 'video/quicktime',
688
- 'mkv' => 'video/x-matroska',
689
- 'mp3' => 'audio/mpeg',
690
- 'mp4' => 'video/mp4',
691
- 'mp4a' => 'audio/mp4',
692
- 'mp4v' => 'video/mp4',
693
- 'mpe' => 'video/mpeg',
694
- 'mpeg' => 'video/mpeg',
695
- 'mpg' => 'video/mpeg',
696
- 'mpg4' => 'video/mp4',
697
- 'oga' => 'audio/ogg',
698
- 'ogg' => 'audio/ogg',
699
- 'ogv' => 'video/ogg',
700
- 'ogx' => 'application/ogg',
701
- 'pbm' => 'image/x-portable-bitmap',
702
- 'pdf' => 'application/pdf',
703
- 'pgm' => 'image/x-portable-graymap',
704
- 'png' => 'image/png',
705
- 'pnm' => 'image/x-portable-anymap',
706
- 'ppm' => 'image/x-portable-pixmap',
707
- 'ppt' => 'application/vnd.ms-powerpoint',
708
- 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
709
- 'ps' => 'application/postscript',
710
- 'qt' => 'video/quicktime',
711
- 'rar' => 'application/x-rar-compressed',
712
- 'ras' => 'image/x-cmu-raster',
713
- 'rss' => 'application/rss+xml',
714
- 'rtf' => 'application/rtf',
715
- 'sgm' => 'text/sgml',
716
- 'sgml' => 'text/sgml',
717
- 'svg' => 'image/svg+xml',
718
- 'swf' => 'application/x-shockwave-flash',
719
- 'tar' => 'application/x-tar',
720
- 'tif' => 'image/tiff',
721
- 'tiff' => 'image/tiff',
722
- 'torrent' => 'application/x-bittorrent',
723
- 'ttf' => 'application/x-font-ttf',
724
- 'txt' => 'text/plain',
725
- 'wav' => 'audio/x-wav',
726
- 'webm' => 'video/webm',
727
- 'webp' => 'image/webp',
728
- 'wma' => 'audio/x-ms-wma',
729
- 'wmv' => 'video/x-ms-wmv',
730
- 'woff' => 'application/x-font-woff',
731
- 'wsdl' => 'application/wsdl+xml',
732
- 'xbm' => 'image/x-xbitmap',
733
- 'xls' => 'application/vnd.ms-excel',
734
- 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
735
- 'xml' => 'application/xml',
736
- 'xpm' => 'image/x-xpixmap',
737
- 'xwd' => 'image/x-xwindowdump',
738
- 'yaml' => 'text/yaml',
739
- 'yml' => 'text/yaml',
740
- 'zip' => 'application/zip',
741
- ];
742
-
743
- $extension = strtolower($extension);
744
-
745
- return isset($mimetypes[$extension])
746
- ? $mimetypes[$extension]
747
- : null;
748
  }
749
 
750
  /**
@@ -757,61 +359,13 @@ function mimetype_from_extension($extension)
757
  * @param string $message HTTP request or response to parse.
758
  *
759
  * @return array
 
760
  * @internal
 
761
  */
762
  function _parse_message($message)
763
  {
764
- if (!$message) {
765
- throw new \InvalidArgumentException('Invalid message');
766
- }
767
-
768
- $message = ltrim($message, "\r\n");
769
-
770
- $messageParts = preg_split("/\r?\n\r?\n/", $message, 2);
771
-
772
- if ($messageParts === false || count($messageParts) !== 2) {
773
- throw new \InvalidArgumentException('Invalid message: Missing header delimiter');
774
- }
775
-
776
- list($rawHeaders, $body) = $messageParts;
777
- $rawHeaders .= "\r\n"; // Put back the delimiter we split previously
778
- $headerParts = preg_split("/\r?\n/", $rawHeaders, 2);
779
-
780
- if ($headerParts === false || count($headerParts) !== 2) {
781
- throw new \InvalidArgumentException('Invalid message: Missing status line');
782
- }
783
-
784
- list($startLine, $rawHeaders) = $headerParts;
785
-
786
- if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') {
787
- // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0
788
- $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders);
789
- }
790
-
791
- /** @var array[] $headerLines */
792
- $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER);
793
-
794
- // If these aren't the same, then one line didn't match and there's an invalid header.
795
- if ($count !== substr_count($rawHeaders, "\n")) {
796
- // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4
797
- if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) {
798
- throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding');
799
- }
800
-
801
- throw new \InvalidArgumentException('Invalid header syntax');
802
- }
803
-
804
- $headers = [];
805
-
806
- foreach ($headerLines as $headerLine) {
807
- $headers[$headerLine[1]][] = $headerLine[2];
808
- }
809
-
810
- return [
811
- 'start-line' => $startLine,
812
- 'headers' => $headers,
813
- 'body' => $body,
814
- ];
815
  }
816
 
817
  /**
@@ -821,79 +375,43 @@ function _parse_message($message)
821
  * @param array $headers Array of headers (each value an array).
822
  *
823
  * @return string
 
824
  * @internal
 
825
  */
826
  function _parse_request_uri($path, array $headers)
827
  {
828
- $hostKey = array_filter(array_keys($headers), function ($k) {
829
- return strtolower($k) === 'host';
830
- });
831
-
832
- // If no host is found, then a full URI cannot be constructed.
833
- if (!$hostKey) {
834
- return $path;
835
- }
836
-
837
- $host = $headers[reset($hostKey)][0];
838
- $scheme = substr($host, -4) === ':443' ? 'https' : 'http';
839
-
840
- return $scheme . '://' . $host . '/' . ltrim($path, '/');
841
  }
842
 
843
  /**
844
- * Get a short summary of the message body
845
  *
846
  * Will return `null` if the response is not printable.
847
  *
848
  * @param MessageInterface $message The message to get the body summary
849
  * @param int $truncateAt The maximum allowed size of the summary
850
  *
851
- * @return null|string
 
 
852
  */
853
  function get_message_body_summary(MessageInterface $message, $truncateAt = 120)
854
  {
855
- $body = $message->getBody();
856
-
857
- if (!$body->isSeekable() || !$body->isReadable()) {
858
- return null;
859
- }
860
-
861
- $size = $body->getSize();
862
-
863
- if ($size === 0) {
864
- return null;
865
- }
866
-
867
- $summary = $body->read($truncateAt);
868
- $body->rewind();
869
-
870
- if ($size > $truncateAt) {
871
- $summary .= ' (truncated...)';
872
- }
873
-
874
- // Matches any printable character, including unicode characters:
875
- // letters, marks, numbers, punctuation, spacing, and separators.
876
- if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) {
877
- return null;
878
- }
879
-
880
- return $summary;
881
  }
882
 
883
- /** @internal */
 
 
 
 
 
 
 
 
 
884
  function _caseless_remove($keys, array $data)
885
  {
886
- $result = [];
887
-
888
- foreach ($keys as &$key) {
889
- $key = strtolower($key);
890
- }
891
-
892
- foreach ($data as $k => $v) {
893
- if (!in_array(strtolower($k), $keys)) {
894
- $result[$k] = $v;
895
- }
896
- }
897
-
898
- return $result;
899
  }
1
  <?php
2
+
3
  namespace GuzzleHttp\Psr7;
4
 
5
  use Psr\Http\Message\MessageInterface;
6
  use Psr\Http\Message\RequestInterface;
 
 
7
  use Psr\Http\Message\StreamInterface;
8
  use Psr\Http\Message\UriInterface;
9
 
13
  * @param MessageInterface $message Message to convert to a string.
14
  *
15
  * @return string
16
+ *
17
+ * @deprecated str will be removed in guzzlehttp/psr7:2.0. Use Message::toString instead.
18
  */
19
  function str(MessageInterface $message)
20
  {
21
+ return Message::toString($message);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
 
24
  /**
25
  * Returns a UriInterface for the given value.
26
  *
27
+ * This function accepts a string or UriInterface and returns a
28
+ * UriInterface for the given value. If the value is already a
29
+ * UriInterface, it is returned as-is.
30
  *
31
  * @param string|UriInterface $uri
32
  *
33
  * @return UriInterface
34
+ *
35
  * @throws \InvalidArgumentException
36
+ *
37
+ * @deprecated uri_for will be removed in guzzlehttp/psr7:2.0. Use Utils::uriFor instead.
38
  */
39
  function uri_for($uri)
40
  {
41
+ return Utils::uriFor($uri);
 
 
 
 
 
 
42
  }
43
 
44
  /**
48
  * - metadata: Array of custom metadata.
49
  * - size: Size of the stream.
50
  *
51
+ * This method accepts the following `$resource` types:
52
+ * - `Psr\Http\Message\StreamInterface`: Returns the value as-is.
53
+ * - `string`: Creates a stream object that uses the given string as the contents.
54
+ * - `resource`: Creates a stream object that wraps the given PHP stream resource.
55
+ * - `Iterator`: If the provided value implements `Iterator`, then a read-only
56
+ * stream object will be created that wraps the given iterable. Each time the
57
+ * stream is read from, data from the iterator will fill a buffer and will be
58
+ * continuously called until the buffer is equal to the requested read size.
59
+ * Subsequent read calls will first read from the buffer and then call `next`
60
+ * on the underlying iterator until it is exhausted.
61
+ * - `object` with `__toString()`: If the object has the `__toString()` method,
62
+ * the object will be cast to a string and then a stream will be returned that
63
+ * uses the string value.
64
+ * - `NULL`: When `null` is passed, an empty stream object is returned.
65
+ * - `callable` When a callable is passed, a read-only stream object will be
66
+ * created that invokes the given callable. The callable is invoked with the
67
+ * number of suggested bytes to read. The callable can return any number of
68
+ * bytes, but MUST return `false` when there is no more data to return. The
69
+ * stream object that wraps the callable will invoke the callable until the
70
+ * number of requested bytes are available. Any additional bytes will be
71
+ * buffered and used in subsequent reads.
72
+ *
73
  * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data
74
  * @param array $options Additional options
75
  *
76
  * @return StreamInterface
77
+ *
78
  * @throws \InvalidArgumentException if the $resource arg is not valid.
79
+ *
80
+ * @deprecated stream_for will be removed in guzzlehttp/psr7:2.0. Use Utils::streamFor instead.
81
  */
82
  function stream_for($resource = '', array $options = [])
83
  {
84
+ return Utils::streamFor($resource, $options);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
86
 
87
  /**
88
  * Parse an array of header values containing ";" separated data into an
89
+ * array of associative arrays representing the header key value pair data
90
+ * of the header. When a parameter does not contain a value, but just
91
  * contains a key, this function will inject a key with a '' string value.
92
  *
93
  * @param string|array $header Header to parse into components.
94
  *
95
  * @return array Returns the parsed header values.
96
+ *
97
+ * @deprecated parse_header will be removed in guzzlehttp/psr7:2.0. Use Header::parse instead.
98
  */
99
  function parse_header($header)
100
  {
101
+ return Header::parse($header);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  }
103
 
104
  /**
108
  * @param string|array $header Header to normalize.
109
  *
110
  * @return array Returns the normalized header field values.
111
+ *
112
+ * @deprecated normalize_header will be removed in guzzlehttp/psr7:2.0. Use Header::normalize instead.
113
  */
114
  function normalize_header($header)
115
  {
116
+ return Header::normalize($header);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  }
118
 
119
  /**
120
  * Clone and modify a request with the given changes.
121
  *
122
+ * This method is useful for reducing the number of clones needed to mutate a
123
+ * message.
124
+ *
125
  * The changes can be one of:
126
  * - method: (string) Changes the HTTP method.
127
  * - set_headers: (array) Sets the given headers.
135
  * @param array $changes Changes to apply.
136
  *
137
  * @return RequestInterface
138
+ *
139
+ * @deprecated modify_request will be removed in guzzlehttp/psr7:2.0. Use Utils::modifyRequest instead.
140
  */
141
  function modify_request(RequestInterface $request, array $changes)
142
  {
143
+ return Utils::modifyRequest($request, $changes);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  }
145
 
146
  /**
152
  * @param MessageInterface $message Message to rewind
153
  *
154
  * @throws \RuntimeException
155
+ *
156
+ * @deprecated rewind_body will be removed in guzzlehttp/psr7:2.0. Use Message::rewindBody instead.
157
  */
158
  function rewind_body(MessageInterface $message)
159
  {
160
+ Message::rewindBody($message);
 
 
 
 
161
  }
162
 
163
  /**
170
  * @param string $mode Mode used to open the file
171
  *
172
  * @return resource
173
+ *
174
  * @throws \RuntimeException if the file cannot be opened
175
+ *
176
+ * @deprecated try_fopen will be removed in guzzlehttp/psr7:2.0. Use Utils::tryFopen instead.
177
  */
178
  function try_fopen($filename, $mode)
179
  {
180
+ return Utils::tryFopen($filename, $mode);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  }
182
 
183
  /**
188
  * @param int $maxLen Maximum number of bytes to read. Pass -1
189
  * to read the entire stream.
190
  * @return string
191
+ *
192
  * @throws \RuntimeException on error.
193
+ *
194
+ * @deprecated copy_to_string will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToString instead.
195
  */
196
  function copy_to_string(StreamInterface $stream, $maxLen = -1)
197
  {
198
+ return Utils::copyToString($stream, $maxLen);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  }
200
 
201
  /**
208
  * to read the entire stream.
209
  *
210
  * @throws \RuntimeException on error.
211
+ *
212
+ * @deprecated copy_to_stream will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToStream instead.
213
  */
214
+ function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)
215
+ {
216
+ return Utils::copyToStream($source, $dest, $maxLen);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  }
218
 
219
  /**
220
+ * Calculate a hash of a stream.
221
+ *
222
+ * This method reads the entire stream to calculate a rolling hash, based on
223
+ * PHP's `hash_init` functions.
224
  *
225
  * @param StreamInterface $stream Stream to calculate the hash for
226
  * @param string $algo Hash algorithm (e.g. md5, crc32, etc)
227
  * @param bool $rawOutput Whether or not to use raw output
228
  *
229
  * @return string Returns the hash of the stream
230
+ *
231
  * @throws \RuntimeException on error.
232
+ *
233
+ * @deprecated hash will be removed in guzzlehttp/psr7:2.0. Use Utils::hash instead.
234
  */
235
+ function hash(StreamInterface $stream, $algo, $rawOutput = false)
236
+ {
237
+ return Utils::hash($stream, $algo, $rawOutput);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
239
 
240
  /**
241
+ * Read a line from the stream up to the maximum allowed buffer length.
242
  *
243
  * @param StreamInterface $stream Stream to read from
244
+ * @param int|null $maxLength Maximum buffer length
245
  *
246
  * @return string
247
+ *
248
+ * @deprecated readline will be removed in guzzlehttp/psr7:2.0. Use Utils::readLine instead.
249
  */
250
  function readline(StreamInterface $stream, $maxLength = null)
251
  {
252
+ return Utils::readLine($stream, $maxLength);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  }
254
 
255
  /**
258
  * @param string $message Request message string.
259
  *
260
  * @return Request
261
+ *
262
+ * @deprecated parse_request will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequest instead.
263
  */
264
  function parse_request($message)
265
  {
266
+ return Message::parseRequest($message);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  }
268
 
269
  /**
272
  * @param string $message Response message string.
273
  *
274
  * @return Response
275
+ *
276
+ * @deprecated parse_response will be removed in guzzlehttp/psr7:2.0. Use Message::parseResponse instead.
277
  */
278
  function parse_response($message)
279
  {
280
+ return Message::parseResponse($message);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  }
282
 
283
  /**
284
  * Parse a query string into an associative array.
285
  *
286
+ * If multiple values are found for the same key, the value of that key value
287
+ * pair will become an array. This function does not parse nested PHP style
288
+ * arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed
289
+ * into `['foo[a]' => '1', 'foo[b]' => '2'])`.
290
  *
291
  * @param string $str Query string to parse
292
  * @param int|bool $urlEncoding How the query string is encoded
293
  *
294
  * @return array
295
+ *
296
+ * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead.
297
  */
298
  function parse_query($str, $urlEncoding = true)
299
  {
300
+ return Query::parse($str, $urlEncoding);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  }
302
 
303
  /**
304
  * Build a query string from an array of key value pairs.
305
  *
306
+ * This function can use the return value of `parse_query()` to build a query
307
  * string. This function does not modify the provided keys when an array is
308
+ * encountered (like `http_build_query()` would).
309
  *
310
  * @param array $params Query string parameters.
311
  * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
312
  * to encode using RFC3986, or PHP_QUERY_RFC1738
313
  * to encode using RFC1738.
314
  * @return string
315
+ *
316
+ * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead.
317
  */
318
  function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
319
  {
320
+ return Query::build($params, $encoding);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  }
322
 
323
  /**
324
  * Determines the mimetype of a file by looking at its extension.
325
  *
326
+ * @param string $filename
327
+ *
328
+ * @return string|null
329
  *
330
+ * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead.
331
  */
332
  function mimetype_from_filename($filename)
333
  {
334
+ return MimeType::fromFilename($filename);
335
  }
336
 
337
  /**
340
  * @param $extension string The file extension.
341
  *
342
  * @return string|null
343
+ *
344
  * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
345
+ * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead.
346
  */
347
  function mimetype_from_extension($extension)
348
  {
349
+ return MimeType::fromExtension($extension);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  }
351
 
352
  /**
359
  * @param string $message HTTP request or response to parse.
360
  *
361
  * @return array
362
+ *
363
  * @internal
364
+ * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead.
365
  */
366
  function _parse_message($message)
367
  {
368
+ return Message::parseMessage($message);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  }
370
 
371
  /**
375
  * @param array $headers Array of headers (each value an array).
376
  *
377
  * @return string
378
+ *
379
  * @internal
380
+ * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead.
381
  */
382
  function _parse_request_uri($path, array $headers)
383
  {
384
+ return Message::parseRequestUri($path, $headers);
 
 
 
 
 
 
 
 
 
 
 
 
385
  }
386
 
387
  /**
388
+ * Get a short summary of the message body.
389
  *
390
  * Will return `null` if the response is not printable.
391
  *
392
  * @param MessageInterface $message The message to get the body summary
393
  * @param int $truncateAt The maximum allowed size of the summary
394
  *
395
+ * @return string|null
396
+ *
397
+ * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead.
398
  */
399
  function get_message_body_summary(MessageInterface $message, $truncateAt = 120)
400
  {
401
+ return Message::bodySummary($message, $truncateAt);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
402
  }
403
 
404
+ /**
405
+ * Remove the items given by the keys, case insensitively from the data.
406
+ *
407
+ * @param iterable<string> $keys
408
+ *
409
+ * @return array
410
+ *
411
+ * @internal
412
+ * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead.
413
+ */
414
  function _caseless_remove($keys, array $data)
415
  {
416
+ return Utils::caselessRemove($keys, $data);
 
 
 
 
 
 
 
 
 
 
 
 
417
  }
vendor/masterminds/html5/.php_cs.dist DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
-
3
- $finder = PhpCsFixer\Finder::create()
4
- ->in(__DIR__)
5
- ;
6
-
7
- return PhpCsFixer\Config::create()
8
- ->setRules(array(
9
- '@Symfony' => true,
10
- 'concat_space' => array('spacing' => 'one'),
11
- 'phpdoc_annotation_without_dot' => false,
12
- ))
13
- ->setFinder($finder)
14
- ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/.scrutinizer.yml DELETED
@@ -1,41 +0,0 @@
1
- tools:
2
- php_mess_detector: true
3
- php_analyzer:
4
- config:
5
- parameter_reference_check: { enabled: false }
6
- checkstyle: { enabled: false, no_trailing_whitespace: true, naming: { enabled: true, local_variable: '^[a-z][a-zA-Z0-9]*$', abstract_class_name: ^Abstract|Factory$, utility_class_name: 'Utils?$', constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$', property_name: '^[a-z][a-zA-Z0-9]*$', method_name: '^(?:[a-z]|__)[a-zA-Z0-9]*$', parameter_name: '^[a-z][a-zA-Z0-9]*$', interface_name: '^[A-Z][a-zA-Z0-9]*Interface$', type_name: '^[A-Z][a-zA-Z0-9]*$', exception_name: '^[A-Z][a-zA-Z0-9]*Exception$', isser_method_name: '^(?:is|has|should|may|supports)' } }
7
- unreachable_code: { enabled: false }
8
- check_access_control: { enabled: false }
9
- typo_checks: { enabled: false }
10
- check_variables: { enabled: false }
11
- check_calls: { enabled: true, too_many_arguments: true, missing_argument: true, argument_type_checks: lenient }
12
- suspicious_code: { enabled: false, overriding_parameter: false, overriding_closure_use: false, parameter_closure_use_conflict: false, parameter_multiple_times: false, non_existent_class_in_instanceof_check: false, non_existent_class_in_catch_clause: false, assignment_of_null_return: false, non_commented_switch_fallthrough: false, non_commented_empty_catch_block: false, overriding_private_members: false, use_statement_alias_conflict: false, precedence_in_condition_assignment: false }
13
- dead_assignments: { enabled: false }
14
- verify_php_doc_comments: { enabled: false, parameters: false, return: false, suggest_more_specific_types: false, ask_for_return_if_not_inferrable: false, ask_for_param_type_annotation: false }
15
- loops_must_use_braces: { enabled: false }
16
- check_usage_context: { enabled: true, foreach: { value_as_reference: true, traversable: true } }
17
- simplify_boolean_return: { enabled: false }
18
- phpunit_checks: { enabled: false }
19
- reflection_checks: { enabled: false }
20
- precedence_checks: { enabled: true, assignment_in_condition: true, comparison_of_bit_result: true }
21
- basic_semantic_checks: { enabled: false }
22
- unused_code: { enabled: false }
23
- deprecation_checks: { enabled: false }
24
- useless_function_calls: { enabled: false }
25
- metrics_lack_of_cohesion_methods: { enabled: false }
26
- metrics_coupling: { enabled: true, stable_code: { namespace_prefixes: { }, classes: { } } }
27
- doctrine_parameter_binding: { enabled: false }
28
- doctrine_entity_manager_injection: { enabled: false }
29
- symfony_request_injection: { enabled: false }
30
- doc_comment_fixes: { enabled: false }
31
- reflection_fixes: { enabled: false }
32
- use_statement_fixes: { enabled: true, remove_unused: true, preserve_multiple: false, preserve_blanklines: false, order_alphabetically: false }
33
- php_code_sniffer: true
34
- sensiolabs_security_checker: true
35
- php_cpd: true
36
- php_loc: true
37
- php_pdepend: true
38
- external_code_coverage: true
39
- filter:
40
- paths:
41
- - src/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/RELEASE.md CHANGED
@@ -1,5 +1,11 @@
1
  # Release Notes
2
 
 
 
 
 
 
 
3
  2.7.3 (2020-07-05)
4
 
5
  - #190: mitigate cyclic reference between output rules and the traverser objects
1
  # Release Notes
2
 
3
+ 2.7.4 (2020-10-01)
4
+
5
+ - #191: Fix travisci build
6
+ - #195: Add .gitattributes file with export-ignore rules
7
+ - #194: Fix query parameter parsed as character entity
8
+
9
  2.7.3 (2020-07-05)
10
 
11
  - #190: mitigate cyclic reference between output rules and the traverser objects
vendor/masterminds/html5/example.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
-
3
- require 'vendor/autoload.php';
4
- use Masterminds\HTML5;
5
-
6
- $html = <<< 'HERE'
7
- <html>
8
- <head>
9
- <title>TEST</title>
10
- <script language="javascript">
11
- if (2 > 1) { alert("Math wins."); }
12
- </script>
13
- </head>
14
- <body id='foo'>
15
- <!-- This space intentionally left blank. -->
16
- <section class="section-a pretty" id="bar1">
17
- <h1>Hello World</h1><p>This is a test of the HTML5 parser.</p>
18
- <hr>
19
- &amp; Nobody nowhere.
20
- </section>
21
- <test xmlns:foo="http://example.com/foo">TEST</test>
22
- <![CDATA[Because we can.]]>
23
- &copy;
24
- </body></html>
25
- HERE;
26
-
27
- $html5 = new HTML5();
28
- $dom = $html5->loadHTML($html);
29
-
30
- echo "Converting to HTML 5\n";
31
-
32
- $html5->save($dom, fopen('php://stdin', 'w'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/phpunit.xml.dist DELETED
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <phpunit colors="true" bootstrap="vendor/autoload.php">
3
- <testsuites>
4
- <testsuite name="PHPUnit">
5
- <directory>test/HTML5/</directory>
6
- </testsuite>
7
- </testsuites>
8
- <filter>
9
- <blacklist>
10
- <file>systemlib.phpreflection_hni</file>
11
- <file>src/HTML5/Parser/InputStream.php</file>
12
- <file>src/HTML5/Serializer/RulesInterface.php</file>
13
- <file>src/HTML5/Entities.php</file>
14
- <file>src/HTML5/Serializer/HTML5Entities.php</file>
15
- </blacklist>
16
- </filter>
17
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/sami.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- use Sami\Sami;
4
-
5
- return new Sami(__DIR__ . '/src', array(
6
- 'title' => 'HTML5-PHP API',
7
- 'build_dir' => __DIR__ . '/build/apidoc',
8
- 'cache_dir' => __DIR__ . '/build/sami-cache',
9
- 'default_opened_level' => 1,
10
- ));
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php CHANGED
@@ -475,7 +475,7 @@ class DOMTreeBuilder implements EventHandler
475
  $lname = $this->normalizeTagName($name);
476
 
477
  // Special case within 12.2.6.4.7: An end tag whose tag name is "br" should be treated as an opening tag
478
- if ($name === 'br') {
479
  $this->parseError('Closing tag encountered for void element br.');
480
 
481
  $this->startTag('br');
475
  $lname = $this->normalizeTagName($name);
476
 
477
  // Special case within 12.2.6.4.7: An end tag whose tag name is "br" should be treated as an opening tag
478
+ if ('br' === $name) {
479
  $this->parseError('Closing tag encountered for void element br.');
480
 
481
  $this->startTag('br');
vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php CHANGED
@@ -1181,16 +1181,11 @@ class Tokenizer
1181
  return $entity;
1182
  }
1183
 
1184
- // If in an attribute, then failing to match ; means unconsume the
1185
- // entire string. Otherwise, failure to match is an error.
1186
- if ($inAttribute) {
1187
- $this->scanner->unconsume($this->scanner->position() - $start);
1188
-
1189
- return '&';
1190
- }
1191
 
1192
  $this->parseError('Expected &ENTITY;, got &ENTITY%s (no trailing ;) ', $tok);
1193
 
1194
- return '&' . $entity;
1195
  }
1196
  }
1181
  return $entity;
1182
  }
1183
 
1184
+ // Failing to match ; means unconsume the entire string.
1185
+ $this->scanner->unconsume($this->scanner->position() - $start);
 
 
 
 
 
1186
 
1187
  $this->parseError('Expected &ENTITY;, got &ENTITY%s (no trailing ;) ', $tok);
1188
 
1189
+ return '&';
1190
  }
1191
  }
vendor/masterminds/html5/test/HTML5/ElementsTest.php DELETED
@@ -1,485 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests;
4
-
5
- use Masterminds\HTML5\Elements;
6
-
7
- class ElementsTest extends TestCase
8
- {
9
- public $html5Elements = array(
10
- 'a',
11
- 'abbr',
12
- 'address',
13
- 'area',
14
- 'article',
15
- 'aside',
16
- 'audio',
17
- 'b',
18
- 'base',
19
- 'bdi',
20
- 'bdo',
21
- 'blockquote',
22
- 'body',
23
- 'br',
24
- 'button',
25
- 'canvas',
26
- 'caption',
27
- 'cite',
28
- 'code',
29
- 'col',
30
- 'colgroup',
31
- 'command',
32
- // "data",
33
- 'datalist',
34
- 'dd',
35
- 'del',
36
- 'details',
37
- 'dfn',
38
- 'dialog',
39
- 'div',
40
- 'dl',
41
- 'dt',
42
- 'em',
43
- 'embed',
44
- 'fieldset',
45
- 'figcaption',
46
- 'figure',
47
- 'footer',
48
- 'form',
49
- 'h1',
50
- 'h2',
51
- 'h3',
52
- 'h4',
53
- 'h5',
54
- 'h6',
55
- 'head',
56
- 'header',
57
- 'hgroup',
58
- 'hr',
59
- 'html',
60
- 'i',
61
- 'iframe',
62
- 'img',
63
- 'input',
64
- 'ins',
65
- 'kbd',
66
- 'keygen',
67
- 'label',
68
- 'legend',
69
- 'li',
70
- 'link',
71
- 'map',
72
- 'mark',
73
- 'menu',
74
- 'meta',
75
- 'meter',
76
- 'nav',
77
- 'noscript',
78
- 'object',
79
- 'ol',
80
- 'optgroup',
81
- 'option',
82
- 'output',
83
- 'p',
84
- 'param',
85
- 'pre',
86
- 'progress',
87
- 'q',
88
- 'rp',
89
- 'rt',
90
- 'ruby',
91
- 's',
92
- 'samp',
93
- 'script',
94
- 'section',
95
- 'select',
96
- 'small',
97
- 'source',
98
- 'span',
99
- 'strong',
100
- 'style',
101
- 'sub',
102
- 'summary',
103
- 'sup',
104
- 'table',
105
- 'tbody',
106
- 'td',
107
- 'textarea',
108
- 'tfoot',
109
- 'th',
110
- 'thead',
111
- 'time',
112
- 'title',
113
- 'tr',
114
- 'track',
115
- 'u',
116
- 'ul',
117
- 'var',
118
- 'video',
119
- 'wbr',
120
- );
121
-
122
- public $mathmlElements = array(
123
- 'maction',
124
- 'maligngroup',
125
- 'malignmark',
126
- 'math',
127
- 'menclose',
128
- 'merror',
129
- 'mfenced',
130
- 'mfrac',
131
- 'mglyph',
132
- 'mi',
133
- 'mlabeledtr',
134
- 'mlongdiv',
135
- 'mmultiscripts',
136
- 'mn',
137
- 'mo',
138
- 'mover',
139
- 'mpadded',
140
- 'mphantom',
141
- 'mroot',
142
- 'mrow',
143
- 'ms',
144
- 'mscarries',
145
- 'mscarry',
146
- 'msgroup',
147
- 'msline',
148
- 'mspace',
149
- 'msqrt',
150
- 'msrow',
151
- 'mstack',
152
- 'mstyle',
153
- 'msub',
154
- 'msup',
155
- 'msubsup',
156
- 'mtable',
157
- 'mtd',
158
- 'mtext',
159
- 'mtr',
160
- 'munder',
161
- 'munderover',
162
- );
163
-
164
- public $svgElements = array(
165
- 'a',
166
- 'altGlyph',
167
- 'altGlyphDef',
168
- 'altGlyphItem',
169
- 'animate',
170
- 'animateColor',
171
- 'animateMotion',
172
- 'animateTransform',
173
- 'circle',
174
- 'clipPath',
175
- 'color-profile',
176
- 'cursor',
177
- 'defs',
178
- 'desc',
179
- 'ellipse',
180
- 'feBlend',
181
- 'feColorMatrix',
182
- 'feComponentTransfer',
183
- 'feComposite',
184
- 'feConvolveMatrix',
185
- 'feDiffuseLighting',
186
- 'feDisplacementMap',
187
- 'feDistantLight',
188
- 'feFlood',
189
- 'feFuncA',
190
- 'feFuncB',
191
- 'feFuncG',
192
- 'feFuncR',
193
- 'feGaussianBlur',
194
- 'feImage',
195
- 'feMerge',
196
- 'feMergeNode',
197
- 'feMorphology',
198
- 'feOffset',
199
- 'fePointLight',
200
- 'feSpecularLighting',
201
- 'feSpotLight',
202
- 'feTile',
203
- 'feTurbulence',
204
- 'filter',
205
- 'font',
206
- 'font-face',
207
- 'font-face-format',
208
- 'font-face-name',
209
- 'font-face-src',
210
- 'font-face-uri',
211
- 'foreignObject',
212
- 'g',
213
- 'glyph',
214
- 'glyphRef',
215
- 'hkern',
216
- 'image',
217
- 'line',
218
- 'linearGradient',
219
- 'marker',
220
- 'mask',
221
- 'metadata',
222
- 'missing-glyph',
223
- 'mpath',
224
- 'path',
225
- 'pattern',
226
- 'polygon',
227
- 'polyline',
228
- 'radialGradient',
229
- 'rect',
230
- 'script',
231
- 'set',
232
- 'stop',
233
- 'style',
234
- 'svg',
235
- 'switch',
236
- 'symbol',
237
- 'text',
238
- 'textPath',
239
- 'title',
240
- 'tref',
241
- 'tspan',
242
- 'use',
243
- 'view',
244
- 'vkern',
245
- );
246
-
247
- public function testIsHtml5Element()
248
- {
249
- foreach ($this->html5Elements as $element) {
250
- $this->assertTrue(Elements::isHtml5Element($element), 'html5 element test failed on: ' . $element);
251
-
252
- $this->assertTrue(Elements::isHtml5Element(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element));
253
- }
254
-
255
- $nonhtml5 = array(
256
- 'foo',
257
- 'bar',
258
- 'baz',
259
- );
260
- foreach ($nonhtml5 as $element) {
261
- $this->assertFalse(Elements::isHtml5Element($element), 'html5 element test failed on: ' . $element);
262
-
263
- $this->assertFalse(Elements::isHtml5Element(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element));
264
- }
265
- }
266
-
267
- public function testIsMathMLElement()
268
- {
269
- foreach ($this->mathmlElements as $element) {
270
- $this->assertTrue(Elements::isMathMLElement($element), 'MathML element test failed on: ' . $element);
271
-
272
- // MathML is case sensitive so these should all fail.
273
- $this->assertFalse(Elements::isMathMLElement(strtoupper($element)), 'MathML element test failed on: ' . strtoupper($element));
274
- }
275
-
276
- $nonMathML = array(
277
- 'foo',
278
- 'bar',
279
- 'baz',
280
- );
281
- foreach ($nonMathML as $element) {
282
- $this->assertFalse(Elements::isMathMLElement($element), 'MathML element test failed on: ' . $element);
283
- }
284
- }
285
-
286
- public function testIsSvgElement()
287
- {
288
- foreach ($this->svgElements as $element) {
289
- $this->assertTrue(Elements::isSvgElement($element), 'SVG element test failed on: ' . $element);
290
-
291
- // SVG is case sensitive so these should all fail.
292
- $this->assertFalse(Elements::isSvgElement(strtoupper($element)), 'SVG element test failed on: ' . strtoupper($element));
293
- }
294
-
295
- $nonSVG = array(
296
- 'foo',
297
- 'bar',
298
- 'baz',
299
- );
300
- foreach ($nonSVG as $element) {
301
- $this->assertFalse(Elements::isSvgElement($element), 'SVG element test failed on: ' . $element);
302
- }
303
- }
304
-
305
- public function testIsElement()
306
- {
307
- foreach ($this->html5Elements as $element) {
308
- $this->assertTrue(Elements::isElement($element), 'html5 element test failed on: ' . $element);
309
-
310
- $this->assertTrue(Elements::isElement(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element));
311
- }
312
-
313
- foreach ($this->mathmlElements as $element) {
314
- $this->assertTrue(Elements::isElement($element), 'MathML element test failed on: ' . $element);
315
-
316
- // MathML is case sensitive so these should all fail.
317
- $this->assertFalse(Elements::isElement(strtoupper($element)), 'MathML element test failed on: ' . strtoupper($element));
318
- }
319
-
320
- foreach ($this->svgElements as $element) {
321
- $this->assertTrue(Elements::isElement($element), 'SVG element test failed on: ' . $element);
322
-
323
- // SVG is case sensitive so these should all fail. But, there is duplication
324
- // html5 and SVG. Since html5 is case insensitive we need to make sure
325
- // it's not a html5 element first.
326
- if (!in_array($element, $this->html5Elements)) {
327
- $this->assertFalse(Elements::isElement(strtoupper($element)), 'SVG element test failed on: ' . strtoupper($element));
328
- }
329
- }
330
-
331
- $nonhtml5 = array(
332
- 'foo',
333
- 'bar',
334
- 'baz',
335
- );
336
- foreach ($nonhtml5 as $element) {
337
- $this->assertFalse(Elements::isElement($element), 'html5 element test failed on: ' . $element);
338
-
339
- $this->assertFalse(Elements::isElement(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element));
340
- }
341
- }
342
-
343
- public function testElement()
344
- {
345
- foreach ($this->html5Elements as $element) {
346
- $this->assertGreaterThan(0, Elements::element($element));
347
- }
348
- $nonhtml5 = array(
349
- 'foo',
350
- 'bar',
351
- 'baz',
352
- );
353
- foreach ($nonhtml5 as $element) {
354
- $this->assertEquals(0, Elements::element($element));
355
- }
356
- }
357
-
358
- public function testIsA()
359
- {
360
- $this->assertTrue(Elements::isA('script', Elements::KNOWN_ELEMENT));
361
- $this->assertFalse(Elements::isA('scriptypoo', Elements::KNOWN_ELEMENT));
362
- $this->assertTrue(Elements::isA('script', Elements::TEXT_RAW));
363
- $this->assertFalse(Elements::isA('script', Elements::TEXT_RCDATA));
364
-
365
- $voidElements = array(
366
- 'area',
367
- 'base',
368
- 'basefont',
369
- 'bgsound',
370
- 'br',
371
- 'col',
372
- 'command',
373
- 'embed',
374
- 'frame',
375
- 'hr',
376
- 'img',
377
- );
378
-
379
- foreach ($voidElements as $element) {
380
- $this->assertTrue(Elements::isA($element, Elements::VOID_TAG), 'Void element test failed on: ' . $element);
381
- }
382
-
383
- $nonVoid = array(
384
- 'span',
385
- 'a',
386
- 'div',
387
- );
388
- foreach ($nonVoid as $tag) {
389
- $this->assertFalse(Elements::isA($tag, Elements::VOID_TAG), 'Void element test failed on: ' . $tag);
390
- }
391
-
392
- $blockTags = array(
393
- 'address',
394
- 'article',
395
- 'aside',
396
- 'blockquote',
397
- 'canvas',
398
- 'dd',
399
- 'div',
400
- 'dl',
401
- 'fieldset',
402
- 'figcaption',
403
- 'figure',
404
- 'footer',
405
- 'form',
406
- 'h1',
407
- 'h2',
408
- 'h3',
409
- 'h4',
410
- 'h5',
411
- 'h6',
412
- 'header',
413
- 'hgroup',
414
- 'hr',
415
- 'noscript',
416
- 'ol',
417
- 'output',
418
- 'p',
419
- 'pre',
420
- 'section',
421
- 'table',
422
- 'tfoot',
423
- 'ul',
424
- 'video',
425
- );
426
-
427
- foreach ($blockTags as $tag) {
428
- $this->assertTrue(Elements::isA($tag, Elements::BLOCK_TAG), 'Block tag test failed on: ' . $tag);
429
- }
430
-
431
- $nonBlockTags = array(
432
- 'span',
433
- 'img',
434
- 'label',
435
- );
436
- foreach ($nonBlockTags as $tag) {
437
- $this->assertFalse(Elements::isA($tag, Elements::BLOCK_TAG), 'Block tag test failed on: ' . $tag);
438
- }
439
- }
440
-
441
- public function testNormalizeSvgElement()
442
- {
443
- $tests = array(
444
- 'foo' => 'foo',
445
- 'altglyph' => 'altGlyph',
446
- 'BAR' => 'bar',
447
- 'fespecularlighting' => 'feSpecularLighting',
448
- 'bAz' => 'baz',
449
- 'foreignobject' => 'foreignObject',
450
- );
451
-
452
- foreach ($tests as $input => $expected) {
453
- $this->assertEquals($expected, Elements::normalizeSvgElement($input));
454
- }
455
- }
456
-
457
- public function testNormalizeSvgAttribute()
458
- {
459
- $tests = array(
460
- 'foo' => 'foo',
461
- 'attributename' => 'attributeName',
462
- 'BAR' => 'bar',
463
- 'limitingconeangle' => 'limitingConeAngle',
464
- 'bAz' => 'baz',
465
- 'patterncontentunits' => 'patternContentUnits',
466
- );
467
-
468
- foreach ($tests as $input => $expected) {
469
- $this->assertEquals($expected, Elements::normalizeSvgAttribute($input));
470
- }
471
- }
472
-
473
- public function testNormalizeMathMlAttribute()
474
- {
475
- $tests = array(
476
- 'foo' => 'foo',
477
- 'definitionurl' => 'definitionURL',
478
- 'BAR' => 'bar',
479
- );
480
-
481
- foreach ($tests as $input => $expected) {
482
- $this->assertEquals($expected, Elements::normalizeMathMlAttribute($input));
483
- }
484
- }
485
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Fixtures/encoding/utf-8.html DELETED
@@ -1,9 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
5
- </head>
6
- <body>
7
- <p>Žťčýů</p>
8
- </body>
9
- </html>
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Fixtures/encoding/windows-1252.html DELETED
@@ -1,9 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta http-equiv="content-type" content="text/html;charset=windows-1252">
5
- </head>
6
- <body>
7
- <p>�����</p>
8
- </body>
9
- </html>
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Html5Test.html DELETED
@@ -1,10 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Test</title>
6
- </head>
7
- <body>
8
- <p>This is a test.</p>
9
- </body>
10
- </html>
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Html5Test.php DELETED
@@ -1,483 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests;
4
-
5
- use Masterminds\HTML5;
6
-
7
- class Html5Test extends TestCase
8
- {
9
- /**
10
- * @var HTML5
11
- */
12
- private $html5;
13
-
14
- public function setUp()
15
- {
16
- $this->html5 = $this->getInstance();
17
- }
18
-
19
- /**
20
- * Parse and serialize a string.
21
- */
22
- protected function cycle($html)
23
- {
24
- $dom = $this->html5->loadHTML('<!DOCTYPE html><html><body>' . $html . '</body></html>');
25
- $out = $this->html5->saveHTML($dom);
26
-
27
- return $out;
28
- }
29
-
30
- protected function cycleFragment($fragment)
31
- {
32
- $dom = $this->html5->loadHTMLFragment($fragment);
33
- $out = $this->html5->saveHTML($dom);
34
-
35
- return $out;
36
- }
37
-
38
- public function testImageTagsInSvg()
39
- {
40
- $html = '<!DOCTYPE html>
41
- <html>
42
- <head>
43
- <title>foo</title>
44
- </head>
45
- <body>
46
- <svg>
47
- <image height="10" width="10"></image>
48
- </svg>
49
- </body>
50
- </html>';
51
- $doc = $this->html5->loadHTML($html);
52
- $this->assertInstanceOf('DOMElement', $doc->getElementsByTagName('image')->item(0));
53
- $this->assertEmpty($this->html5->getErrors());
54
- }
55
-
56
- public function testLoadOptions()
57
- {
58
- // doc
59
- $dom = $this->html5->loadHTML($this->wrap('<t:tag/>'), array(
60
- 'implicitNamespaces' => array('t' => 'http://example.com'),
61
- 'xmlNamespaces' => true,
62
- ));
63
- $this->assertInstanceOf('\DOMDocument', $dom);
64
- $this->assertEmpty($this->html5->getErrors());
65
- $this->assertFalse($this->html5->hasErrors());
66
-
67
- $xpath = new \DOMXPath($dom);
68
- $xpath->registerNamespace('t', 'http://example.com');
69
- $this->assertEquals(1, $xpath->query('//t:tag')->length);
70
-
71
- // doc fragment
72
- $frag = $this->html5->loadHTMLFragment('<t:tag/>', array(
73
- 'implicitNamespaces' => array('t' => 'http://example.com'),
74
- 'xmlNamespaces' => true,
75
- ));
76
- $this->assertInstanceOf('\DOMDocumentFragment', $frag);
77
- $this->assertEmpty($this->html5->getErrors());
78
- $this->assertFalse($this->html5->hasErrors());
79
-
80
- $frag->ownerDocument->appendChild($frag);
81
- $xpath = new \DOMXPath($frag->ownerDocument);
82
- $xpath->registerNamespace('t', 'http://example.com');
83
- $this->assertEquals(1, $xpath->query('//t:tag', $frag)->length);
84
- }
85
-
86
- public function testEncodingUtf8()
87
- {
88
- $dom = $this->html5->load(__DIR__ . '/Fixtures/encoding/utf-8.html');
89
- $this->assertInstanceOf('\DOMDocument', $dom);
90
- $this->assertEmpty($this->html5->getErrors());
91
- $this->assertFalse($this->html5->hasErrors());
92
-
93
- $this->assertContains('Žťčýů', $dom->saveHTML());
94
- }
95
-
96
- public function testEncodingWindows1252()
97
- {
98
- $dom = $this->html5->load(__DIR__ . '/Fixtures/encoding/windows-1252.html', array(
99
- 'encoding' => 'Windows-1252',
100
- ));
101
-
102
- $this->assertInstanceOf('\DOMDocument', $dom);
103
- $this->assertEmpty($this->html5->getErrors());
104
- $this->assertFalse($this->html5->hasErrors());
105
-
106
- $dumpedAsUtf8 = mb_convert_encoding($dom->saveHTML(), 'UTF-8', 'Windows-1252');
107
- $this->assertNotFalse(mb_strpos($dumpedAsUtf8, 'Ž'));
108
- $this->assertNotFalse(mb_strpos($dumpedAsUtf8, 'è'));
109
- $this->assertNotFalse(mb_strpos($dumpedAsUtf8, 'ý'));
110
- $this->assertNotFalse(mb_strpos($dumpedAsUtf8, 'ù'));
111
- }
112
-
113
- public function testErrors()
114
- {
115
- $dom = $this->html5->loadHTML('<xx as>');
116
- $this->assertInstanceOf('\DOMDocument', $dom);
117
-
118
- $this->assertNotEmpty($this->html5->getErrors());
119
- $this->assertTrue($this->html5->hasErrors());
120
- }
121
-
122
- public function testLoad()
123
- {
124
- $dom = $this->html5->load(__DIR__ . '/Html5Test.html');
125
- $this->assertInstanceOf('\DOMDocument', $dom);
126
- $this->assertEmpty($this->html5->getErrors());
127
- $this->assertFalse($this->html5->hasErrors());
128
-
129
- $file = fopen(__DIR__ . '/Html5Test.html', 'r');
130
- $dom = $this->html5->load($file);
131
- $this->assertInstanceOf('\DOMDocument', $dom);
132
- $this->assertEmpty($this->html5->getErrors());
133
-
134
- $dom = $this->html5->loadHTMLFile(__DIR__ . '/Html5Test.html');
135
- $this->assertInstanceOf('\DOMDocument', $dom);
136
- $this->assertEmpty($this->html5->getErrors());
137
- }
138
-
139
- public function testLoadHTML()
140
- {
141
- $contents = file_get_contents(__DIR__ . '/Html5Test.html');
142
- $dom = $this->html5->loadHTML($contents);
143
- $this->assertInstanceOf('\DOMDocument', $dom);
144
- $this->assertEmpty($this->html5->getErrors());
145
- }
146
-
147
- public function testLoadHTMLWithComments()
148
- {
149
- $contents = '<!--[if lte IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
150
- <!--[if gt IE 8]> <!--><html class="no-js" lang="en"><!--<![endif]-->
151
- </html>';
152
-
153
- $dom = $this->html5->loadHTML($contents);
154
- $this->assertInstanceOf('\DOMDocument', $dom);
155
-
156
- $expected = '<!DOCTYPE html>
157
- <!--[if lte IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--><!--[if gt IE 8]> <!--><html class="no-js" lang="en"><!--<![endif]--></html>
158
- ';
159
- $this->assertEquals($expected, $this->html5->saveHTML($dom));
160
- }
161
-
162
- public function testLoadHTMLFragment()
163
- {
164
- $fragment = '<section id="Foo"><div class="Bar">Baz</div></section>';
165
- $dom = $this->html5->loadHTMLFragment($fragment);
166
- $this->assertInstanceOf('\DOMDocumentFragment', $dom);
167
- $this->assertEmpty($this->html5->getErrors());
168
- }
169
-
170
- public function testSaveHTML()
171
- {
172
- $dom = $this->html5->load(__DIR__ . '/Html5Test.html');
173
- $this->assertInstanceOf('\DOMDocument', $dom);
174
- $this->assertEmpty($this->html5->getErrors());
175
-
176
- $saved = $this->html5->saveHTML($dom);
177
- $this->assertRegExp('|<p>This is a test.</p>|', $saved);
178
- }
179
-
180
- public function testSaveHTMLFragment()
181
- {
182
- $fragment = '<section id="Foo"><div class="Bar">Baz</div></section>';
183
- $dom = $this->html5->loadHTMLFragment($fragment);
184
-
185
- $string = $this->html5->saveHTML($dom);
186
- $this->assertEquals($fragment, $string);
187
- }
188
-
189
- public function testSave()
190
- {
191
- $dom = $this->html5->load(__DIR__ . '/Html5Test.html');
192
- $this->assertInstanceOf('\DOMDocument', $dom);
193
- $this->assertEmpty($this->html5->getErrors());
194
-
195
- // Test resource
196
- $file = fopen('php://temp', 'w');
197
- $this->html5->save($dom, $file);
198
- $content = stream_get_contents($file, -1, 0);
199
- $this->assertRegExp('|<p>This is a test.</p>|', $content);
200
-
201
- // Test file
202
- $tmpfname = tempnam(sys_get_temp_dir(), 'html5-php');
203
- $this->html5->save($dom, $tmpfname);
204
- $content = file_get_contents($tmpfname);
205
- $this->assertRegExp('|<p>This is a test.</p>|', $content);
206
- unlink($tmpfname);
207
- }
208
-
209
- // This test reads a document into a dom, turn the dom into a document,
210
- // then tries to read that document again. This makes sure we are reading,
211
- // and generating a document that works at a high level.
212
- public function testItWorks()
213
- {
214
- $dom = $this->html5->load(__DIR__ . '/Html5Test.html');
215
- $this->assertInstanceOf('\DOMDocument', $dom);
216
- $this->assertEmpty($this->html5->getErrors());
217
-
218
- $saved = $this->html5->saveHTML($dom);
219
-
220
- $dom2 = $this->html5->loadHTML($saved);
221
- $this->assertInstanceOf('\DOMDocument', $dom2);
222
- $this->assertEmpty($this->html5->getErrors());
223
- }
224
-
225
- public function testConfig()
226
- {
227
- $html5 = $this->getInstance();
228
- $options = $html5->getOptions();
229
- $this->assertEquals(false, $options['encode_entities']);
230
-
231
- $html5 = $this->getInstance(array(
232
- 'foo' => 'bar',
233
- 'encode_entities' => true,
234
- ));
235
- $options = $html5->getOptions();
236
- $this->assertEquals('bar', $options['foo']);
237
- $this->assertEquals(true, $options['encode_entities']);
238
-
239
- // Need to reset to original so future tests pass as expected.
240
- // $this->getInstance()->setOption('encode_entities', false);
241
- }
242
-
243
- public function testSvg()
244
- {
245
- $dom = $this->html5->loadHTML(
246
- '<!doctype html>
247
- <html lang="en">
248
- <body>
249
- <div id="foo" class="bar baz">foo bar baz</div>
250
- <svg width="150" height="100" viewBox="0 0 3 2">
251
- <rect width="1" height="2" x="0" fill="#008d46" />
252
- <rect width="1" height="2" x="1" fill="#ffffff" />
253
- <rect width="1" height="2" x="2" fill="#d2232c" />
254
- <text font-family="Verdana" font-size="32">
255
- <textPath xlink:href="#Foo">
256
- Test Text.
257
- </textPath>
258
- </text>
259
- </svg>
260
- </body>
261
- </html>');
262
-
263
- $this->assertEmpty($this->html5->getErrors());
264
-
265
- // Test a mixed case attribute.
266
- $list = $dom->getElementsByTagName('svg');
267
- $this->assertNotEmpty($list->length);
268
- $svg = $list->item(0);
269
- $this->assertEquals('0 0 3 2', $svg->getAttribute('viewBox'));
270
- $this->assertFalse($svg->hasAttribute('viewbox'));
271
-
272
- // Test a mixed case tag.
273
- // Note: getElementsByTagName is not case sensitive.
274
- $list = $dom->getElementsByTagName('textPath');
275
- $this->assertNotEmpty($list->length);
276
- $textPath = $list->item(0);
277
- $this->assertEquals('textPath', $textPath->tagName);
278
- $this->assertNotEquals('textpath', $textPath->tagName);
279
-
280
- $html = $this->html5->saveHTML($dom);
281
- $this->assertRegExp('|<svg width="150" height="100" viewBox="0 0 3 2">|', $html);
282
- $this->assertRegExp('|<rect width="1" height="2" x="0" fill="#008d46" />|', $html);
283
- }
284
-
285
- public function testMathMl()
286
- {
287
- $dom = $this->html5->loadHTML(
288
- '<!doctype html>
289
- <html lang="en">
290
- <body>
291
- <div id="foo" class="bar baz" definitionURL="http://example.com">foo bar baz</div>
292
- <math>
293
- <mi>x</mi>
294
- <csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">
295
- <mo>&PlusMinus;</mo>
296
- </csymbol>
297
- <mi>y</mi>
298
- </math>
299
- </body>
300
- </html>');
301
-
302
- $this->assertEmpty($this->html5->getErrors());
303
- $list = $dom->getElementsByTagName('math');
304
- $this->assertNotEmpty($list->length);
305
-
306
- $list = $dom->getElementsByTagName('div');
307
- $this->assertNotEmpty($list->length);
308
- $div = $list->item(0);
309
- $this->assertEquals('http://example.com', $div->getAttribute('definitionurl'));
310
- $this->assertFalse($div->hasAttribute('definitionURL'));
311
- $list = $dom->getElementsByTagName('csymbol');
312
- $csymbol = $list->item(0);
313
- $this->assertEquals('http://www.example.com/mathops/multiops.html#plusminus', $csymbol->getAttribute('definitionURL'));
314
- $this->assertFalse($csymbol->hasAttribute('definitionurl'));
315
-
316
- $html = $this->html5->saveHTML($dom);
317
- $this->assertRegExp('|<csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">|', $html);
318
- $this->assertRegExp('|<mi>y</mi>|', $html);
319
- }
320
-
321
- public function testUnknownElements()
322
- {
323
- // The : should not have special handling accourding to section 2.9 of the
324
- // spec. This is differenant than XML. Since we don't know these elements
325
- // they are handled as normal elements. Note, to do this is really
326
- // an invalid example and you should not embed prefixed xml in html5.
327
- $dom = $this->html5->loadHTMLFragment(
328
- '<f:rug>
329
- <f:name>Big rectangle thing</f:name>
330
- <f:width>40</f:width>
331
- <f:length>80</f:length>
332
- </f:rug>
333
- <sarcasm>um, yeah</sarcasm>');
334
-
335
- $this->assertEmpty($this->html5->getErrors());
336
- $markup = $this->html5->saveHTML($dom);
337
- $this->assertRegExp('|<f:name>Big rectangle thing</f:name>|', $markup);
338
- $this->assertRegExp('|<sarcasm>um, yeah</sarcasm>|', $markup);
339
- }
340
-
341
- public function testElements()
342
- {
343
- // Should have content.
344
- $res = $this->cycle('<div>FOO</div>');
345
- $this->assertRegExp('|<div>FOO</div>|', $res);
346
-
347
- // Should be empty
348
- $res = $this->cycle('<span></span>');
349
- $this->assertRegExp('|<span></span>|', $res);
350
-
351
- // Should have content.
352
- $res = $this->cycleFragment('<div>FOO</div>');
353
- $this->assertRegExp('|<div>FOO</div>|', $res);
354
-
355
- // Should be empty
356
- $res = $this->cycleFragment('<span></span>');
357
- $this->assertRegExp('|<span></span>|', $res);
358
-
359
- // Elements with dashes and underscores
360
- $res = $this->cycleFragment('<sp-an></sp-an>');
361
- $this->assertRegExp('|<sp-an></sp-an>|', $res);
362
- $res = $this->cycleFragment('<sp_an></sp_an>');
363
- $this->assertRegExp('|<sp_an></sp_an>|', $res);
364
-
365
- // Should have no closing tag.
366
- $res = $this->cycle('<hr>');
367
- $this->assertRegExp('|<hr></body>|', $res);
368
- }
369
-
370
- public function testAttributes()
371
- {
372
- $res = $this->cycle('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use>');
373
- $this->assertContains('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use>', $res);
374
-
375
- $res = $this->cycle('<div attr="val">FOO</div>');
376
- $this->assertRegExp('|<div attr="val">FOO</div>|', $res);
377
-
378
- // XXX: Note that spec does NOT require attrs in the same order.
379
- $res = $this->cycle('<div attr="val" class="even">FOO</div>');
380
- $this->assertRegExp('|<div attr="val" class="even">FOO</div>|', $res);
381
-
382
- $res = $this->cycle('<div xmlns:foo="http://example.com">FOO</div>');
383
- $this->assertRegExp('|<div xmlns:foo="http://example.com">FOO</div>|', $res);
384
-
385
- $res = $this->cycleFragment('<div attr="val">FOO</div>');
386
- $this->assertRegExp('|<div attr="val">FOO</div>|', $res);
387
-
388
- // XXX: Note that spec does NOT require attrs in the same order.
389
- $res = $this->cycleFragment('<div attr="val" class="even">FOO</div>');
390
- $this->assertRegExp('|<div attr="val" class="even">FOO</div>|', $res);
391
-
392
- $res = $this->cycleFragment('<div xmlns:foo="http://example.com">FOO</div>');
393
- $this->assertRegExp('|<div xmlns:foo="http://example.com">FOO</div>|', $res);
394
- }
395
-
396
- public function testPCData()
397
- {
398
- $res = $this->cycle('<a>This is a test.</a>');
399
- $this->assertRegExp('|This is a test.|', $res);
400
-
401
- $res = $this->cycleFragment('<a>This is a test.</a>');
402
- $this->assertRegExp('|This is a test.|', $res);
403
-
404
- $res = $this->cycle('This
405
- is
406
- a
407
- test.');
408
-
409
- // Check that newlines are there, but don't count spaces.
410
- $this->assertRegExp('|This\n\s*is\n\s*a\n\s*test.|', $res);
411
-
412
- $res = $this->cycleFragment('This
413
- is
414
- a
415
- test.');
416
-
417
- // Check that newlines are there, but don't count spaces.
418
- $this->assertRegExp('|This\n\s*is\n\s*a\n\s*test.|', $res);
419
-
420
- $res = $this->cycle('<a>This <em>is</em> a test.</a>');
421
- $this->assertRegExp('|This <em>is</em> a test.|', $res);
422
-
423
- $res = $this->cycleFragment('<a>This <em>is</em> a test.</a>');
424
- $this->assertRegExp('|This <em>is</em> a test.|', $res);
425
- }
426
-
427
- public function testUnescaped()
428
- {
429
- $res = $this->cycle('<script>2 < 1</script>');
430
- $this->assertRegExp('|2 < 1|', $res);
431
-
432
- $res = $this->cycle('<style>div>div>div</style>');
433
- $this->assertRegExp('|div>div>div|', $res);
434
-
435
- $res = $this->cycleFragment('<script>2 < 1</script>');
436
- $this->assertRegExp('|2 < 1|', $res);
437
-
438
- $res = $this->cycleFragment('<style>div>div>div</style>');
439
- $this->assertRegExp('|div>div>div|', $res);
440
- }
441
-
442
- public function testEntities()
443
- {
444
- $res = $this->cycle('<a>Apples &amp; bananas.</a>');
445
- $this->assertRegExp('|Apples &amp; bananas.|', $res);
446
-
447
- $res = $this->cycleFragment('<a>Apples &amp; bananas.</a>');
448
- $this->assertRegExp('|Apples &amp; bananas.|', $res);
449
-
450
- $res = $this->cycleFragment('<p>R&D</p>');
451
- $this->assertRegExp('|R&amp;D|', $res);
452
- }
453
-
454
- public function testCaseSensitiveTags()
455
- {
456
- $dom = $this->html5->loadHTML(
457
- '<html><body><Button color="red">Error</Button></body></html>',
458
- array(
459
- 'xmlNamespaces' => true,
460
- )
461
- );
462
- $out = $this->html5->saveHTML($dom);
463
- $this->assertRegExp('|<html><body><Button color="red">Error</Button></body></html>|', $out);
464
- }
465
-
466
- public function testComment()
467
- {
468
- $res = $this->cycle('a<!-- This is a test. -->b');
469
- $this->assertRegExp('|<!-- This is a test. -->|', $res);
470
-
471
- $res = $this->cycleFragment('a<!-- This is a test. -->b');
472
- $this->assertRegExp('|<!-- This is a test. -->|', $res);
473
- }
474
-
475
- public function testCDATA()
476
- {
477
- $res = $this->cycle('a<![CDATA[ This <is> a test. ]]>b');
478
- $this->assertRegExp('|<!\[CDATA\[ This <is> a test\. \]\]>|', $res);
479
-
480
- $res = $this->cycleFragment('a<![CDATA[ This <is> a test. ]]>b');
481
- $this->assertRegExp('|<!\[CDATA\[ This <is> a test\. \]\]>|', $res);
482
- }
483
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * @file
4
- * Test the Scanner. This requires the InputStream tests are all good.
5
- */
6
-
7
- namespace Masterminds\HTML5\Tests\Parser;
8
-
9
- use Masterminds\HTML5\Parser\CharacterReference;
10
-
11
- class CharacterReferenceTest extends \Masterminds\HTML5\Tests\TestCase
12
- {
13
- public function testLookupName()
14
- {
15
- $this->assertEquals('&', CharacterReference::lookupName('amp'));
16
- $this->assertEquals('<', CharacterReference::lookupName('lt'));
17
- $this->assertEquals('>', CharacterReference::lookupName('gt'));
18
- $this->assertEquals('"', CharacterReference::lookupName('quot'));
19
- $this->assertEquals('∌', CharacterReference::lookupName('NotReverseElement'));
20
-
21
- $this->assertNull(CharacterReference::lookupName('StinkyCheese'));
22
- }
23
-
24
- public function testLookupHex()
25
- {
26
- $this->assertEquals('<', CharacterReference::lookupHex('3c'));
27
- $this->assertEquals('<', CharacterReference::lookupHex('003c'));
28
- $this->assertEquals('&', CharacterReference::lookupHex('26'));
29
- $this->assertEquals('}', CharacterReference::lookupHex('7d'));
30
- $this->assertEquals('Σ', CharacterReference::lookupHex('3A3'));
31
- $this->assertEquals('Σ', CharacterReference::lookupHex('03A3'));
32
- $this->assertEquals('Σ', CharacterReference::lookupHex('3a3'));
33
- $this->assertEquals('Σ', CharacterReference::lookupHex('03a3'));
34
- }
35
-
36
- public function testLookupDecimal()
37
- {
38
- $this->assertEquals('&', CharacterReference::lookupDecimal(38));
39
- $this->assertEquals('&', CharacterReference::lookupDecimal('38'));
40
- $this->assertEquals('<', CharacterReference::lookupDecimal(60));
41
- $this->assertEquals('Σ', CharacterReference::lookupDecimal(931));
42
- $this->assertEquals('Σ', CharacterReference::lookupDecimal('0931'));
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php DELETED
@@ -1,743 +0,0 @@
1
- <?php
2
- /**
3
- * @file
4
- * Test the Tree Builder.
5
- */
6
-
7
- namespace Masterminds\HTML5\Tests\Parser;
8
-
9
- use Masterminds\HTML5\Parser\Scanner;
10
- use Masterminds\HTML5\Parser\Tokenizer;
11
- use Masterminds\HTML5\Parser\DOMTreeBuilder;
12
-
13
- /**
14
- * These tests are functional, not necessarily unit tests.
15
- */
16
- class DOMTreeBuilderTest extends \Masterminds\HTML5\Tests\TestCase
17
- {
18
- protected $errors = array();
19
-
20
- /**
21
- * Convenience function for parsing.
22
- */
23
- protected function parse($string, array $options = array())
24
- {
25
- $treeBuilder = new DOMTreeBuilder(false, $options);
26
- $scanner = new Scanner($string);
27
- $parser = new Tokenizer($scanner, $treeBuilder);
28
-
29
- $parser->parse();
30
- $this->errors = $treeBuilder->getErrors();
31
-
32
- return $treeBuilder->document();
33
- }
34
-
35
- /**
36
- * Utility function for parsing a fragment of HTML5.
37
- */
38
- protected function parseFragment($string)
39
- {
40
- $treeBuilder = new DOMTreeBuilder(true);
41
- $scanner = new Scanner($string);
42
- $parser = new Tokenizer($scanner, $treeBuilder);
43
-
44
- $parser->parse();
45
- $this->errors = $treeBuilder->getErrors();
46
-
47
- return $treeBuilder->fragment();
48
- }
49
-
50
- public function testDocument()
51
- {
52
- $html = '<!DOCTYPE html><html></html>';
53
- $doc = $this->parse($html);
54
-
55
- $this->assertEquals('UTF-8', $doc->encoding);
56
- $this->assertInstanceOf('\DOMDocument', $doc);
57
- $this->assertEquals('html', $doc->documentElement->tagName);
58
- $this->assertEquals('http://www.w3.org/1999/xhtml', $doc->documentElement->namespaceURI);
59
- }
60
-
61
- public function testBareAmpersand()
62
- {
63
- $html = "<!doctype html>
64
- <html>
65
- <body>
66
- <img src='a&b' />
67
- <img src='a&=' />
68
- <img src='a&=c' />
69
- <img src='a&=9' />
70
- </body>
71
- </html>";
72
- $doc = $this->parse($html);
73
-
74
- $this->assertEmpty($this->errors);
75
- $this->assertXmlStringEqualsXmlString('
76
- <!DOCTYPE html>
77
- <html xmlns="http://www.w3.org/1999/xhtml"><body>
78
- <img src="a&amp;b"/>
79
- <img src="a&amp;="/>
80
- <img src="a&amp;=c"/>
81
- <img src="a&amp;=9"/>
82
- </body>
83
- </html>', $doc->saveXML());
84
- }
85
-
86
- public function testBareAmpersandNotAllowedInAttributes()
87
- {
88
- $html = "<!doctype html>
89
- <html>
90
- <body>
91
- <img src='a&' />
92
- <img src='a&+' />
93
- </body>
94
- </html>";
95
- $doc = $this->parse($html);
96
-
97
- $this->assertCount(2, $this->errors);
98
- $this->assertXmlStringEqualsXmlString('
99
- <!DOCTYPE html>
100
- <html xmlns="http://www.w3.org/1999/xhtml"><body>
101
- <img src="a&amp;"/>
102
- <img src="a&amp;+"/>
103
- </body>
104
- </html>', $doc->saveXML());
105
- }
106
-
107
- public function testBareAmpersandNotAllowedInBody()
108
- {
109
- $html = '<!doctype html>
110
- <html>
111
- <body>
112
- a&b
113
- a&=
114
- a&=c
115
- a&=9
116
- a&+
117
- a& -- valid
118
- </body>
119
- </html>';
120
- $doc = $this->parse($html);
121
-
122
- $this->assertCount(5, $this->errors);
123
- $this->assertXmlStringEqualsXmlString('
124
- <!DOCTYPE html>
125
- <html xmlns="http://www.w3.org/1999/xhtml"><body>
126
- a&amp;b
127
- a&amp;=
128
- a&amp;=c
129
- a&amp;=9
130
- a&amp;+
131
- a&amp; -- valid
132
- </body>
133
- </html>', $doc->saveXML());
134
- }
135
-
136
- public function testEntityAtEndOfFile()
137
- {
138
- $fragment = $this->parseFragment('&#');
139
- $this->assertInstanceOf('DOMDocumentFragment', $fragment);
140
- $this->assertSame('&#', $fragment->textContent);
141
- $this->assertEquals('Line 1, Col 2: Expected &#DEC; &#HEX;, got EOF', $this->errors[0]);
142
- }
143
-
144
- public function testStrangeCapitalization()
145
- {
146
- $html = '<!doctype html>
147
- <html>
148
- <head>
149
- <Title>Hello, world!</TitlE>
150
- </head>
151
- <body>TheBody<script>foo</script></body>
152
- </html>';
153
- $doc = $this->parse($html);
154
-
155
- $this->assertInstanceOf('\DOMDocument', $doc);
156
- $this->assertEquals('html', $doc->documentElement->tagName);
157
-
158
- $xpath = new \DOMXPath($doc);
159
- $xpath->registerNamespace('x', 'http://www.w3.org/1999/xhtml');
160
-
161
- $this->assertEquals('Hello, world!', $xpath->query('//x:title')->item(0)->nodeValue);
162
- $this->assertEquals('foo', $xpath->query('//x:script')->item(0)->nodeValue);
163
- }
164
-
165
- public function testDocumentWithDisabledNamespaces()
166
- {
167
- $html = '<!DOCTYPE html><html></html>';
168
- $doc = $this->parse($html, array('disable_html_ns' => true));
169
-
170
- $this->assertInstanceOf('\DOMDocument', $doc);
171
- $this->assertEquals('html', $doc->documentElement->tagName);
172
- $this->assertNull($doc->documentElement->namespaceURI);
173
- }
174
-
175
- public function testDocumentWithATargetDocument()
176
- {
177
- $targetDom = new \DOMDocument();
178
-
179
- $html = '<!DOCTYPE html><html></html>';
180
- $doc = $this->parse($html, array('target_document' => $targetDom));
181
-
182
- $this->assertInstanceOf('\DOMDocument', $doc);
183
- $this->assertSame($doc, $targetDom);
184
- $this->assertEquals('html', $doc->documentElement->tagName);
185
- }
186
-
187
- public function testDocumentFakeAttrAbsence()
188
- {
189
- $html = '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><body>foo</body></html>';
190
- $doc = $this->parse($html, array('xmlNamespaces' => true));
191
-
192
- $xp = new \DOMXPath($doc);
193
- $this->assertEquals(0, $xp->query('//@html5-php-fake-id-attribute')->length);
194
- }
195
-
196
- public function testFragment()
197
- {
198
- $html = '<div>test</div><span>test2</span>';
199
- $doc = $this->parseFragment($html);
200
-
201
- $this->assertInstanceOf('\DOMDocumentFragment', $doc);
202
- $this->assertTrue($doc->hasChildNodes());
203
- $this->assertEquals('div', $doc->childNodes->item(0)->tagName);
204
- $this->assertEquals('test', $doc->childNodes->item(0)->textContent);
205
- $this->assertEquals('span', $doc->childNodes->item(1)->tagName);
206
- $this->assertEquals('test2', $doc->childNodes->item(1)->textContent);
207
- }
208
-
209
- public function testElements()
210
- {
211
- $html = '<!DOCTYPE html><html><head><title></title></head><body></body></html>';
212
- $doc = $this->parse($html);
213
- $root = $doc->documentElement;
214
-
215
- $this->assertEquals('html', $root->tagName);
216
- $this->assertEquals('html', $root->localName);
217
- $this->assertEquals('html', $root->nodeName);
218
-
219
- $this->assertEquals(2, $root->childNodes->length);
220
- $kids = $root->childNodes;
221
-
222
- $this->assertEquals('head', $kids->item(0)->tagName);
223
- $this->assertEquals('body', $kids->item(1)->tagName);
224
-
225
- $head = $kids->item(0);
226
- $this->assertEquals(1, $head->childNodes->length);
227
- $this->assertEquals('title', $head->childNodes->item(0)->tagName);
228
- }
229
-
230
- public function testImplicitNamespaces()
231
- {
232
- $dom = $this->parse('<!DOCTYPE html><html><body><a xlink:href="bar">foo</a></body></html>');
233
- $a = $dom->getElementsByTagName('a')->item(0);
234
- $attr = $a->getAttributeNode('xlink:href');
235
- $this->assertEquals('http://www.w3.org/1999/xlink', $attr->namespaceURI);
236
-
237
- $dom = $this->parse('<!DOCTYPE html><html><body><a xml:base="bar">foo</a></body></html>');
238
- $a = $dom->getElementsByTagName('a')->item(0);
239
- $attr = $a->getAttributeNode('xml:base');
240
- $this->assertEquals('http://www.w3.org/XML/1998/namespace', $attr->namespaceURI);
241
- }
242
-
243
- public function testCustomImplicitNamespaces()
244
- {
245
- $dom = $this->parse('<!DOCTYPE html><html><body><a t:href="bar">foo</a></body></html>', array(
246
- 'implicitNamespaces' => array(
247
- 't' => 'http://www.example.com',
248
- ),
249
- ));
250
- $a = $dom->getElementsByTagName('a')->item(0);
251
- $attr = $a->getAttributeNode('t:href');
252
- $this->assertEquals('http://www.example.com', $attr->namespaceURI);
253
-
254
- $dom = $this->parse('<!DOCTYPE html><html><body><t:a>foo</t:a></body></html>', array(
255
- 'implicitNamespaces' => array(
256
- 't' => 'http://www.example.com',
257
- ),
258
- ));
259
- $list = $dom->getElementsByTagNameNS('http://www.example.com', 'a');
260
- $this->assertEquals(1, $list->length);
261
- }
262
-
263
- public function testXmlNamespaces()
264
- {
265
- $dom = $this->parse(
266
- '<!DOCTYPE html><html>
267
- <t:body xmlns:t="http://www.example.com">
268
- <a t:href="bar">foo</a>
269
- </body>
270
- <div>foo</div>
271
- </html>', array(
272
- 'xmlNamespaces' => true,
273
- ));
274
- $a = $dom->getElementsByTagName('a')->item(0);
275
- $attr = $a->getAttributeNode('t:href');
276
- $this->assertEquals('http://www.example.com', $attr->namespaceURI);
277
-
278
- $list = $dom->getElementsByTagNameNS('http://www.example.com', 'body');
279
- $this->assertEquals(1, $list->length);
280
- }
281
-
282
- public function testXmlNamespaceNesting()
283
- {
284
- $dom = $this->parse(
285
- '<!DOCTYPE html><html>
286
- <body xmlns:x="http://www.prefixed.com" id="body">
287
- <a id="bar1" xmlns="http://www.prefixed.com/bar1">
288
- <b id="bar4" xmlns="http://www.prefixed.com/bar4"><x:prefixed id="prefixed"/></b>
289
- </a>
290
- <svg id="svg"></svg>
291
- <c id="bar2" xmlns="http://www.prefixed.com/bar2"></c>
292
- <div id="div"></div>
293
- <d id="bar3"></d>
294
- <xn:d xmlns:xn="http://www.prefixed.com/xn" xmlns="http://www.prefixed.com/bar5_x" id="bar5"><x id="bar5_x"/></xn:d>
295
- </body>
296
- </html>', array(
297
- 'xmlNamespaces' => true,
298
- ));
299
-
300
- $this->assertEmpty($this->errors);
301
-
302
- $div = $dom->getElementById('div');
303
- $this->assertEquals('http://www.w3.org/1999/xhtml', $div->namespaceURI);
304
-
305
- $body = $dom->getElementById('body');
306
- $this->assertEquals('http://www.w3.org/1999/xhtml', $body->namespaceURI);
307
-
308
- $bar1 = $dom->getElementById('bar1');
309
- $this->assertEquals('http://www.prefixed.com/bar1', $bar1->namespaceURI);
310
-
311
- $bar2 = $dom->getElementById('bar2');
312
- $this->assertEquals('http://www.prefixed.com/bar2', $bar2->namespaceURI);
313
-
314
- $bar3 = $dom->getElementById('bar3');
315
- $this->assertEquals('http://www.w3.org/1999/xhtml', $bar3->namespaceURI);
316
-
317
- $bar4 = $dom->getElementById('bar4');
318
- $this->assertEquals('http://www.prefixed.com/bar4', $bar4->namespaceURI);
319
-
320
- $svg = $dom->getElementById('svg');
321
- $this->assertEquals('http://www.w3.org/2000/svg', $svg->namespaceURI);
322
-
323
- $prefixed = $dom->getElementById('prefixed');
324
- $this->assertEquals('http://www.prefixed.com', $prefixed->namespaceURI);
325
-
326
- $prefixed = $dom->getElementById('bar5');
327
- $this->assertEquals('http://www.prefixed.com/xn', $prefixed->namespaceURI);
328
-
329
- $prefixed = $dom->getElementById('bar5_x');
330
- $this->assertEquals('http://www.prefixed.com/bar5_x', $prefixed->namespaceURI);
331
- }
332
-
333
- public function testMoveNonInlineElements()
334
- {
335
- $doc = $this->parse('<p>line1<br/><hr/>line2</p>');
336
- $this->assertEquals('<html xmlns="http://www.w3.org/1999/xhtml"><p>line1<br/></p><hr/>line2</html>', $doc->saveXML($doc->documentElement), 'Move non-inline elements outside of inline containers.');
337
-
338
- $doc = $this->parse('<p>line1<div>line2</div></p>');
339
- $this->assertEquals('<html xmlns="http://www.w3.org/1999/xhtml"><p>line1</p><div>line2</div></html>', $doc->saveXML($doc->documentElement), 'Move non-inline elements outside of inline containers.');
340
- }
341
-
342
- public function testAttributes()
343
- {
344
- $html = "<!DOCTYPE html>
345
- <html>
346
- <head><title></title></head>
347
- <body id='a' class='b c'></body>
348
- </html>";
349
- $doc = $this->parse($html);
350
- $root = $doc->documentElement;
351
-
352
- $body = $root->GetElementsByTagName('body')->item(0);
353
- $this->assertEquals('body', $body->tagName);
354
- $this->assertTrue($body->hasAttributes());
355
- $this->assertEquals('a', $body->getAttribute('id'));
356
- $this->assertEquals('b c', $body->getAttribute('class'));
357
-
358
- $body2 = $doc->getElementById('a');
359
- $this->assertEquals('body', $body2->tagName);
360
- $this->assertEquals('a', $body2->getAttribute('id'));
361
- }
362
-
363
- public function testSVGAttributes()
364
- {
365
- $html = "<!DOCTYPE html>
366
- <html><body>
367
- <svg width='150' viewbox='2'>
368
- <rect textlength='2'/>
369
- <animatecolor>foo</animatecolor>
370
- </svg>
371
- </body></html>";
372
- $doc = $this->parse($html);
373
- $root = $doc->documentElement;
374
-
375
- $svg = $root->getElementsByTagName('svg')->item(0);
376
- $this->assertTrue($svg->hasAttribute('viewBox'));
377
-
378
- $rect = $root->getElementsByTagName('rect')->item(0);
379
- $this->assertTrue($rect->hasAttribute('textLength'));
380
-
381
- $ac = $root->getElementsByTagName('animateColor');
382
- $this->assertEquals(1, $ac->length);
383
- }
384
-
385
- public function testMathMLAttribute()
386
- {
387
- $html = '<!doctype html>
388
- <html lang="en">
389
- <body>
390
- <math>
391
- <mi>x</mi>
392
- <csymbol definitionurl="http://www.example.com/mathops/multiops.html#plusminus">
393
- <mo>&PlusMinus;</mo>
394
- </csymbol>
395
- <mi>y</mi>
396
- </math>
397
- </body>
398
- </html>';
399
-
400
- $doc = $this->parse($html);
401
- $root = $doc->documentElement;
402
-
403
- $csymbol = $root->getElementsByTagName('csymbol')->item(0);
404
- $this->assertTrue($csymbol->hasAttribute('definitionURL'));
405
- }
406
-
407
- public function testMissingHtmlTag()
408
- {
409
- $html = '<!DOCTYPE html><title>test</title>';
410
- $doc = $this->parse($html);
411
-
412
- $this->assertEquals('html', $doc->documentElement->tagName);
413
- $this->assertEquals('title', $doc->documentElement->childNodes->item(0)->tagName);
414
- }
415
-
416
- public function testComment()
417
- {
418
- $html = '<html><!--Hello World.--></html>';
419
-
420
- $doc = $this->parse($html);
421
-
422
- $comment = $doc->documentElement->childNodes->item(0);
423
- $this->assertEquals(XML_COMMENT_NODE, $comment->nodeType);
424
- $this->assertEquals('Hello World.', $comment->data);
425
-
426
- $html = '<!--Hello World.--><html></html>';
427
- $doc = $this->parse($html);
428
-
429
- $comment = $doc->childNodes->item(1);
430
- $this->assertEquals(XML_COMMENT_NODE, $comment->nodeType);
431
- $this->assertEquals('Hello World.', $comment->data);
432
-
433
- $comment = $doc->childNodes->item(2);
434
- $this->assertEquals(XML_ELEMENT_NODE, $comment->nodeType);
435
- $this->assertEquals('html', $comment->tagName);
436
- }
437
-
438
- public function testCDATA()
439
- {
440
- $html = '<!DOCTYPE html><html><math><![CDATA[test]]></math></html>';
441
- $doc = $this->parse($html);
442
-
443
- $wrapper = $doc->getElementsByTagName('math')->item(0);
444
- $this->assertEquals(1, $wrapper->childNodes->length);
445
- $cdata = $wrapper->childNodes->item(0);
446
- $this->assertEquals(XML_CDATA_SECTION_NODE, $cdata->nodeType);
447
- $this->assertEquals('test', $cdata->data);
448
- }
449
-
450
- public function testText()
451
- {
452
- $html = '<!DOCTYPE html><html><head></head><body><math>test</math></body></html>';
453
- $doc = $this->parse($html);
454
-
455
- $wrapper = $doc->getElementsByTagName('math')->item(0);
456
- $this->assertEquals(1, $wrapper->childNodes->length);
457
- $data = $wrapper->childNodes->item(0);
458
- $this->assertEquals(XML_TEXT_NODE, $data->nodeType);
459
- $this->assertEquals('test', $data->data);
460
-
461
- // The DomTreeBuilder has special handling for text when in before head mode.
462
- $html = '<!DOCTYPE html><html>
463
- Foo<head></head><body></body></html>';
464
- $doc = $this->parse($html);
465
- $this->assertEquals('Line 0, Col 0: Unexpected text. Ignoring: Foo', $this->errors[0]);
466
- $headElement = $doc->documentElement->firstChild;
467
- $this->assertEquals('head', $headElement->tagName);
468
- }
469
-
470
- public function testParseErrors()
471
- {
472
- $html = '<!DOCTYPE html><html><math><![CDATA[test';
473
- $doc = $this->parse($html);
474
-
475
- // We're JUST testing that we can access errors. Actual testing of
476
- // error messages happen in the Tokenizer's tests.
477
- $this->assertGreaterThan(0, count($this->errors));
478
- $this->assertTrue(is_string($this->errors[0]));
479
- }
480
-
481
- public function testProcessingInstruction()
482
- {
483
- // Test the simple case, which is where PIs are inserted into the DOM.
484
- $doc = $this->parse('<!DOCTYPE html><html><?foo bar?>');
485
- $this->assertEquals(1, $doc->documentElement->childNodes->length);
486
- $pi = $doc->documentElement->firstChild;
487
- $this->assertInstanceOf('\DOMProcessingInstruction', $pi);
488
- $this->assertEquals('foo', $pi->nodeName);
489
- $this->assertEquals('bar', $pi->data);
490
-
491
- // Leading xml PIs should be ignored.
492
- $doc = $this->parse('<?xml version="1.0"?><!DOCTYPE html><html><head></head></html>');
493
-
494
- $this->assertEquals(2, $doc->childNodes->length);
495
- $this->assertInstanceOf('\DOMDocumentType', $doc->childNodes->item(0));
496
- $this->assertInstanceOf('\DOMElement', $doc->childNodes->item(1));
497
- }
498
-
499
- public function testAutocloseP()
500
- {
501
- $html = '<!DOCTYPE html><html><body><p><figure></body></html>';
502
- $doc = $this->parse($html);
503
-
504
- $p = $doc->getElementsByTagName('p')->item(0);
505
- $this->assertEquals(0, $p->childNodes->length);
506
- $this->assertEquals('figure', $p->nextSibling->tagName);
507
- }
508
-
509
- public function testAutocloseLI()
510
- {
511
- $html = '<!doctype html>
512
- <html lang="en">
513
- <body>
514
- <ul><li>Foo<li>Bar<li>Baz</ul>
515
- </body>
516
- </html>';
517
-
518
- $doc = $this->parse($html);
519
- $length = $doc->getElementsByTagName('ul')->item(0)->childNodes->length;
520
- $this->assertEquals(3, $length);
521
- }
522
-
523
- public function testMathML()
524
- {
525
- $html = '<!doctype html>
526
- <html lang="en">
527
- <body>
528
- <math xmlns="http://www.w3.org/1998/Math/MathML">
529
- <mi>x</mi>
530
- <csymbol definitionurl="http://www.example.com/mathops/multiops.html#plusminus">
531
- <mo>&PlusMinus;</mo>
532
- </csymbol>
533
- <mi>y</mi>
534
- </math>
535
- </body>
536
- </html>';
537
-
538
- $doc = $this->parse($html);
539
- $math = $doc->getElementsByTagName('math')->item(0);
540
- $this->assertEquals('math', $math->tagName);
541
- $this->assertEquals('math', $math->nodeName);
542
- $this->assertEquals('math', $math->localName);
543
- $this->assertEquals('http://www.w3.org/1998/Math/MathML', $math->namespaceURI);
544
- }
545
-
546
- public function testSVG()
547
- {
548
- $html = '<!doctype html>
549
- <html lang="en">
550
- <body>
551
- <svg width="150" height="100" viewBox="0 0 3 2" xmlns="http://www.w3.org/2000/svg">
552
- <rect width="1" height="2" x="2" fill="#d2232c" />
553
- <text font-family="Verdana" font-size="32">
554
- <textpath xlink:href="#Foo">
555
- Test Text.
556
- </textPath>
557
- </text>
558
- </svg>
559
- </body>
560
- </html>';
561
-
562
- $doc = $this->parse($html);
563
- $svg = $doc->getElementsByTagName('svg')->item(0);
564
- $this->assertEquals('svg', $svg->tagName);
565
- $this->assertEquals('svg', $svg->nodeName);
566
- $this->assertEquals('svg', $svg->localName);
567
- $this->assertEquals('http://www.w3.org/2000/svg', $svg->namespaceURI);
568
-
569
- $textPath = $doc->getElementsByTagName('textPath')->item(0);
570
- $this->assertEquals('textPath', $textPath->tagName);
571
- }
572
-
573
- public function testNoScript()
574
- {
575
- $html = '<!DOCTYPE html><html><head><noscript>No JS</noscript></head></html>';
576
- $doc = $this->parse($html);
577
- $this->assertEmpty($this->errors);
578
- $noscript = $doc->getElementsByTagName('noscript')->item(0);
579
- $this->assertEquals('noscript', $noscript->tagName);
580
-
581
- $html = '<!DOCTYPE html><html><body><noscript><p>No JS</p></noscript></body></html>';
582
- $doc = $this->parse($html);
583
- $this->assertEmpty($this->errors);
584
- $p = $doc->getElementsByTagName('p')->item(0);
585
- $this->assertEquals('p', $p->tagName);
586
- }
587
-
588
- /**
589
- * Regression for issue #13.
590
- */
591
- public function testRegressionHTMLNoBody()
592
- {
593
- $html = '<!DOCTYPE html><html><span id="test">Test</span></html>';
594
- $doc = $this->parse($html);
595
- $span = $doc->getElementById('test');
596
-
597
- $this->assertEmpty($this->errors);
598
-
599
- $this->assertEquals('span', $span->tagName);
600
- $this->assertEquals('Test', $span->textContent);
601
- }
602
-
603
- public function testInstructionProcessor()
604
- {
605
- $string = '<!DOCTYPE html><html><?foo bar ?></html>';
606
-
607
- $treeBuilder = new DOMTreeBuilder();
608
- $is = new InstructionProcessorMock();
609
- $treeBuilder->setInstructionProcessor($is);
610
-
611
- $scanner = new Scanner($string);
612
- $parser = new Tokenizer($scanner, $treeBuilder);
613
-
614
- $parser->parse();
615
- $dom = $treeBuilder->document();
616
- $div = $dom->getElementsByTagName('div')->item(0);
617
-
618
- $this->assertEquals(1, $is->count);
619
- $this->assertEquals('foo', $is->name);
620
- $this->assertEquals('bar ', $is->data);
621
- $this->assertEquals('div', $div->tagName);
622
- $this->assertEquals('foo', $div->textContent);
623
- }
624
-
625
- public function testSelectGroupedOptions()
626
- {
627
- $html = <<<EOM
628
- <!DOCTYPE html>
629
- <html>
630
- <head>
631
- <title>testSelectGroupedOptions</title>
632
- </head>
633
- <body>
634
- <select>
635
- <optgroup id="first" label="first">
636
- <option value="foo">foo</option>
637
- <option value="bar">bar</option>
638
- <option value="baz">baz</option>
639
- </optgroup>
640
- <optgroup id="second" label="second">
641
- <option value="lorem">lorem</option>
642
- <option value="ipsum">ipsum</option>
643
- </optgroup>
644
- </select>
645
- </body>
646
- </html>
647
- EOM;
648
- $dom = $this->parse($html);
649
-
650
- $this->assertSame(3, $dom->getElementById('first')->getElementsByTagName('option')->length);
651
- $this->assertSame(2, $dom->getElementById('second')->getElementsByTagName('option')->length);
652
- }
653
-
654
- public function testVoidTag()
655
- {
656
- $html = <<<EOM
657
- <!DOCTYPE html>
658
- <html>
659
- <head>
660
- <title>testVoidTag</title>
661
- <meta>
662
- <meta>
663
- </head>
664
- <body></body>
665
- </html>
666
- EOM;
667
-
668
- $dom = $this->parse($html);
669
- $this->assertSame(2, $dom->getElementsByTagName('meta')->length);
670
- $this->assertSame(0, $dom->getElementsByTagName('meta')->item(0)->childNodes->length);
671
- $this->assertSame(0, $dom->getElementsByTagName('meta')->item(1)->childNodes->length);
672
- }
673
-
674
- public function testIgnoreSelfClosingTag()
675
- {
676
- $html = <<<EOM
677
- <!DOCTYPE html>
678
- <html>
679
- <head>
680
- <title>testIllegalSelfClosingTag</title>
681
- </head>
682
- <body>
683
- <div /><span>Hello, World!</span></div>
684
- </body>
685
- </html>
686
- EOM;
687
-
688
- $dom = $this->parse($html);
689
- $this->assertSame(1, $dom->getElementsByTagName('div')->item(0)->childNodes->length);
690
- }
691
-
692
- public function testIAudioInParagraph()
693
- {
694
- $html = <<<EOM
695
- <!DOCTYPE html>
696
- <html>
697
- <head>
698
- <title>testIllegalSelfClosingTag</title>
699
- </head>
700
- <body>
701
- <p>
702
- <audio preload="none" controls="controls">
703
- <source src="https://example.com/test.mp3" type="audio/mpeg" />
704
- Your browser does not support the audio element.
705
- </audio>
706
- </p>
707
- </body>
708
- </html>>
709
- </html>
710
- EOM;
711
-
712
- $dom = $this->parse($html);
713
- $audio = $dom->getElementsByTagName('audio')->item(0);
714
-
715
- $this->assertSame('p', $audio->parentNode->nodeName);
716
- $this->assertSame(3, $audio->childNodes->length);
717
- }
718
-
719
- public function testClosingBr()
720
- {
721
- $html = <<<EOM
722
- <!DOCTYPE html>
723
- <html>
724
- <head>
725
- <title>testClosingBr</title>
726
- </head>
727
- <body>
728
- <p>
729
- This line ends with a normal line break <br class="attribute-should-be-retained">
730
- This line ends with a line break marked up as a closing tag </br class="attribute-should-be-discarded">
731
- </p>
732
- </body>
733
- </html>>
734
- </html>
735
- EOM;
736
-
737
- $dom = $this->parse($html);
738
-
739
- $this->assertSame(2, $dom->getElementsByTagName('br')->length);
740
- $this->assertSame(1, $dom->getElementsByTagName('br')->item(0)->attributes->length);
741
- $this->assertSame(0, $dom->getElementsByTagName('br')->item(1)->attributes->length);
742
- }
743
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/EventStack.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests\Parser;
4
-
5
- use Masterminds\HTML5\Elements;
6
- use Masterminds\HTML5\Parser\EventHandler;
7
-
8
- /**
9
- * This testing class gathers events from a parser and builds a stack of events.
10
- * It is useful for checking the output of a tokenizer.
11
- *
12
- * IMPORTANT:
13
- *
14
- * The startTag event also kicks the parser into TEXT_RAW when it encounters
15
- * script or pre tags. This is to match the behavior required by the HTML5 spec,
16
- * which says that the tree builder must tell the tokenizer when to switch states.
17
- */
18
- class EventStack implements EventHandler
19
- {
20
- protected $stack;
21
-
22
- public function __construct()
23
- {
24
- $this->stack = array();
25
- }
26
-
27
- /**
28
- * Get the event stack.
29
- */
30
- public function events()
31
- {
32
- return $this->stack;
33
- }
34
-
35
- public function depth()
36
- {
37
- return count($this->stack);
38
- }
39
-
40
- public function get($index)
41
- {
42
- return $this->stack[$index];
43
- }
44
-
45
- protected function store($event, $data = null)
46
- {
47
- $this->stack[] = array(
48
- 'name' => $event,
49
- 'data' => $data,
50
- );
51
- }
52
-
53
- public function doctype($name, $type = 0, $id = null, $quirks = false)
54
- {
55
- $args = array(
56
- $name,
57
- $type,
58
- $id,
59
- $quirks,
60
- );
61
- $this->store('doctype', $args);
62
- }
63
-
64
- public function startTag($name, $attributes = array(), $selfClosing = false)
65
- {
66
- $args = func_get_args();
67
- $this->store('startTag', $args);
68
- if ('pre' == $name || 'script' == $name) {
69
- return Elements::TEXT_RAW;
70
- }
71
- }
72
-
73
- public function endTag($name)
74
- {
75
- $this->store('endTag', array(
76
- $name,
77
- ));
78
- }
79
-
80
- public function comment($cdata)
81
- {
82
- $this->store('comment', array(
83
- $cdata,
84
- ));
85
- }
86
-
87
- public function cdata($data)
88
- {
89
- $this->store('cdata', func_get_args());
90
- }
91
-
92
- public function text($cdata)
93
- {
94
- // fprintf(STDOUT, "Received TEXT event with: " . $cdata);
95
- $this->store('text', array(
96
- $cdata,
97
- ));
98
- }
99
-
100
- public function eof()
101
- {
102
- $this->store('eof');
103
- }
104
-
105
- public function parseError($msg, $line, $col)
106
- {
107
- // throw new EventStackParseError(sprintf("%s (line %d, col %d)", $msg, $line, $col));
108
- // $this->store(sprintf("%s (line %d, col %d)", $msg, $line, $col));
109
- $this->store('error', func_get_args());
110
- }
111
-
112
- public function processingInstruction($name, $data = null)
113
- {
114
- $this->store('pi', func_get_args());
115
- }
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/EventStackError.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests\Parser;
4
-
5
- class EventStackError extends \Exception
6
- {
7
- }
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/InstructionProcessorMock.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests\Parser;
4
-
5
- class InstructionProcessorMock implements \Masterminds\HTML5\InstructionProcessor
6
- {
7
- public $name = null;
8
-
9
- public $data = null;
10
-
11
- public $count = 0;
12
-
13
- public function process(\DOMElement $element, $name, $data)
14
- {
15
- $this->name = $name;
16
- $this->data = $data;
17
- ++$this->count;
18
-
19
- $div = $element->ownerDocument->createElement('div');
20
- $div->nodeValue = 'foo';
21
-
22
- $element->appendChild($div);
23
-
24
- return $div;
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php DELETED
@@ -1,184 +0,0 @@
1
- <?php
2
- /**
3
- * @file
4
- * Test the Scanner. This requires the InputStream tests are all good.
5
- */
6
-
7
- namespace Masterminds\HTML5\Tests\Parser;
8
-
9
- use Masterminds\HTML5\Parser\StringInputStream;
10
- use Masterminds\HTML5\Parser\Scanner;
11
-
12
- class ScannerTest extends \Masterminds\HTML5\Tests\TestCase
13
- {
14
- /**
15
- * A canary test to make sure the basics are setup and working.
16
- */
17
- public function testConstructDeprecated()
18
- {
19
- $is = new StringInputStream('abc');
20
- $s = new Scanner($is);
21
-
22
- $this->assertInstanceOf('\Masterminds\HTML5\Parser\Scanner', $s);
23
- }
24
-
25
- public function testConstruct()
26
- {
27
- $this->assertInstanceOf('\Masterminds\HTML5\Parser\Scanner', new Scanner('abc'));
28
- }
29
-
30
- public function testNextDeprecated()
31
- {
32
- $s = new Scanner(new StringInputStream('abc'));
33
-
34
- $this->assertEquals('b', $s->next());
35
- $this->assertEquals('c', $s->next());
36
- }
37
-
38
- public function testNext()
39
- {
40
- $s = new Scanner('abc');
41
-
42
- $this->assertEquals('b', $s->next());
43
- $this->assertEquals('c', $s->next());
44
- }
45
-
46
- public function testPosition()
47
- {
48
- $s = new Scanner('abc');
49
-
50
- $this->assertEquals(0, $s->position());
51
-
52
- $s->next();
53
- $this->assertEquals(1, $s->position());
54
- }
55
-
56
- public function testPeek()
57
- {
58
- $s = new Scanner('abc');
59
-
60
- $this->assertEquals('b', $s->peek());
61
-
62
- $s->next();
63
- $this->assertEquals('c', $s->peek());
64
- }
65
-
66
- public function testCurrent()
67
- {
68
- $s = new Scanner('abc');
69
-
70
- // Before scanning the string begins the current is empty.
71
- $this->assertEquals('a', $s->current());
72
-
73
- $c = $s->next();
74
- $this->assertEquals('b', $s->current());
75
-
76
- // Test movement through the string.
77
- $c = $s->next();
78
- $this->assertEquals('c', $s->current());
79
- }
80
-
81
- public function testUnconsume()
82
- {
83
- $s = new Scanner('abcdefghijklmnopqrst');
84
-
85
- // Get initial position.
86
- $s->next();
87
- $start = $s->position();
88
-
89
- // Move forward a bunch of positions.
90
- $amount = 7;
91
- for ($i = 0; $i < $amount; ++$i) {
92
- $s->next();
93
- }
94
-
95
- // Roll back the amount we moved forward.
96
- $s->unconsume($amount);
97
-
98
- $this->assertEquals($start, $s->position());
99
- }
100
-
101
- public function testGetHex()
102
- {
103
- $s = new Scanner('ab13ck45DE*');
104
-
105
- $this->assertEquals('ab13c', $s->getHex());
106
-
107
- $s->next();
108
- $this->assertEquals('45DE', $s->getHex());
109
- }
110
-
111
- public function testGetAsciiAlpha()
112
- {
113
- $s = new Scanner('abcdef1%mnop*');
114
-
115
- $this->assertEquals('abcdef', $s->getAsciiAlpha());
116
-
117
- // Move past the 1% to scan the next group of text.
118
- $s->next();
119
- $s->next();
120
- $this->assertEquals('mnop', $s->getAsciiAlpha());
121
- }
122
-
123
- public function testGetAsciiAlphaNum()
124
- {
125
- $s = new Scanner('abcdef1ghpo#mn94op');
126
-
127
- $this->assertEquals('abcdef1ghpo', $s->getAsciiAlphaNum());
128
-
129
- // Move past the # to scan the next group of text.
130
- $s->next();
131
- $this->assertEquals('mn94op', $s->getAsciiAlphaNum());
132
- }
133
-
134
- public function testGetNumeric()
135
- {
136
- $s = new Scanner('1784a 45 9867 #');
137
-
138
- $this->assertEquals('1784', $s->getNumeric());
139
-
140
- // Move past the 'a ' to scan the next group of text.
141
- $s->next();
142
- $s->next();
143
- $this->assertEquals('45', $s->getNumeric());
144
- }
145
-
146
- public function testCurrentLine()
147
- {
148
- $s = new Scanner("1784a\n45\n9867 #\nThis is a test.");
149
-
150
- $this->assertEquals(1, $s->currentLine());
151
-
152
- // Move to the next line.
153
- $s->getAsciiAlphaNum();
154
- $s->next();
155
- $this->assertEquals(2, $s->currentLine());
156
- }
157
-
158
- public function testColumnOffset()
159
- {
160
- $s = new Scanner("1784a a\n45 9867 #\nThis is a test.");
161
-
162
- // Move the pointer to the space.
163
- $s->getAsciiAlphaNum();
164
- $this->assertEquals(5, $s->columnOffset());
165
-
166
- // We move the pointer ahead. There must be a better way to do this.
167
- $s->next();
168
- $s->next();
169
- $s->next();
170
- $s->next();
171
- $s->next();
172
- $s->next();
173
- $this->assertEquals(3, $s->columnOffset());
174
- }
175
-
176
- public function testRemainingChars()
177
- {
178
- $string = "\n45\n9867 #\nThis is a test.";
179
- $s = new Scanner("1784a\n45\n9867 #\nThis is a test.");
180
-
181
- $s->getAsciiAlphaNum();
182
- $this->assertEquals($string, $s->remainingChars());
183
- }
184
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php DELETED
@@ -1,981 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests\Parser;
4
-
5
- use Masterminds\HTML5\Parser\UTF8Utils;
6
- use Masterminds\HTML5\Parser\Scanner;
7
- use Masterminds\HTML5\Parser\Tokenizer;
8
-
9
- class TokenizerTest extends \Masterminds\HTML5\Tests\TestCase
10
- {
11
- // ================================================================
12
- // Additional assertions.
13
- // ================================================================
14
-
15
- /**
16
- * Tests that an event matches both the event type and the expected value.
17
- *
18
- * @param string $type
19
- * Expected event type
20
- * @param string $expects
21
- * The value expected in $event['data'][0]
22
- */
23
- public function assertEventEquals($type, $expects, $event)
24
- {
25
- $this->assertEquals($type, $event['name'], "Event $type for " . print_r($event, true));
26
- if (is_array($expects)) {
27
- $this->assertEquals($expects, $event['data'], "Event $type should equal " . print_r($expects, true) . ': ' . print_r($event, true));
28
- } else {
29
- $d = (is_array($event['data']) ? $event['data'][0] : null);
30
- $this->assertEquals($expects, $d, "Event $type should equal $expects: " . print_r($event, true));
31
- }
32
- }
33
-
34
- /**
35
- * Assert that a given event is 'error'.
36
- */
37
- public function assertEventError($event)
38
- {
39
- $this->assertEquals('error', $event['name'], 'Expected error for event: ' . print_r($event, true));
40
- }
41
-
42
- /**
43
- * Asserts that all of the tests are good.
44
- *
45
- * This loops through a map of tests/expectations and runs a few assertions on each test.
46
- *
47
- * Checks:
48
- * - depth (if depth is > 0)
49
- * - event name
50
- * - matches on event 0.
51
- */
52
- protected function isAllGood($name, $depth, $tests, $debug = false)
53
- {
54
- foreach ($tests as $try => $expects) {
55
- if ($debug) {
56
- fprintf(STDOUT, "%s expects %s\n", $try, print_r($expects, true));
57
- }
58
- $e = $this->parse($try);
59
- if ($depth > 0) {
60
- $this->assertEquals($depth, $e->depth(), "Expected depth $depth for test $try." . print_r($e, true));
61
- }
62
- $this->assertEventEquals($name, $expects, $e->get(0));
63
- }
64
- }
65
-
66
- // ================================================================
67
- // Utility functions.
68
- // ================================================================
69
- public function testParse()
70
- {
71
- list($tok, $events) = $this->createTokenizer('');
72
-
73
- $tok->parse();
74
- $e1 = $events->get(0);
75
-
76
- $this->assertEquals(1, $events->Depth());
77
- $this->assertEquals('eof', $e1['name']);
78
- }
79
-
80
- public function testWhitespace()
81
- {
82
- $spaces = ' ';
83
- list($tok, $events) = $this->createTokenizer($spaces);
84
-
85
- $tok->parse();
86
-
87
- $this->assertEquals(2, $events->depth());
88
-
89
- $e1 = $events->get(0);
90
-
91
- $this->assertEquals('text', $e1['name']);
92
- $this->assertEquals($spaces, $e1['data'][0]);
93
- }
94
-
95
- public function testCharacterReference()
96
- {
97
- $good = array(
98
- '&amp;' => '&',
99
- '&#x0003c;' => '<',
100
- '&#38;' => '&',
101
- '&' => '&',
102
- );
103
- $this->isAllGood('text', 2, $good);
104
-
105
- // Test with broken charref
106
- $str = '&foo';
107
- $events = $this->parse($str);
108
- $e1 = $events->get(0);
109
- $this->assertEquals('error', $e1['name']);
110
-
111
- $str = '&#xfoo';
112
- $events = $this->parse($str);
113
- $e1 = $events->get(0);
114
- $this->assertEquals('error', $e1['name']);
115
-
116
- $str = '&#foo';
117
- $events = $this->parse($str);
118
- $e1 = $events->get(0);
119
- $this->assertEquals('error', $e1['name']);
120
-
121
- // FIXME: Once the text processor is done, need to verify that the
122
- // tokens are transformed correctly into text.
123
- }
124
-
125
- public function testBogusComment()
126
- {
127
- $bogus = array(
128
- '</+this is a bogus comment. +>',
129
- '<!+this is a bogus comment. !>',
130
- '<!D OCTYPE foo bar>',
131
- '<!DOCTYEP foo bar>',
132
- '<![CADATA[ TEST ]]>',
133
- '<![CDATA Hello ]]>',
134
- '<![CDATA[ Hello [[>',
135
- '<!CDATA[[ test ]]>',
136
- '<![CDATA[',
137
- '<![CDATA[hellooooo hello',
138
- '<? Hello World ?>',
139
- '<? Hello World',
140
- );
141
- foreach ($bogus as $str) {
142
- $events = $this->parse($str);
143
- $this->assertEventError($events->get(0));
144
- $this->assertEventEquals('comment', $str, $events->get(1));
145
- }
146
- }
147
-
148
- public function testEndTag()
149
- {
150
- $succeed = array(
151
- '</a>' => 'a',
152
- '</test>' => 'test',
153
- '</test
154
- >' => 'test',
155
- '</thisIsTheTagThatDoesntEndItJustGoesOnAndOnMyFriend>' => 'thisisthetagthatdoesntenditjustgoesonandonmyfriend',
156
- // See 8.2.4.10, which requires this and does not say error.
157
- '</a<b>' => 'a<b',
158
- );
159
- $this->isAllGood('endTag', 2, $succeed);
160
-
161
- // Recoverable failures
162
- $fail = array(
163
- '</a class="monkey">' => 'a',
164
- '</a <b>' => 'a',
165
- '</a <b <c>' => 'a',
166
- '</a is the loneliest letter>' => 'a',
167
- '</a' => 'a',
168
- );
169
- foreach ($fail as $test => $result) {
170
- $events = $this->parse($test);
171
- $this->assertEquals(3, $events->depth());
172
- // Should have triggered an error.
173
- $this->assertEventError($events->get(0));
174
- // Should have tried to parse anyway.
175
- $this->assertEventEquals('endTag', $result, $events->get(1));
176
- }
177
-
178
- // BogoComments
179
- $comments = array(
180
- '</>' => '</>',
181
- '</ >' => '</ >',
182
- '</ a>' => '</ a>',
183
- );
184
- foreach ($comments as $test => $result) {
185
- $events = $this->parse($test);
186
- $this->assertEquals(3, $events->depth());
187
-
188
- // Should have triggered an error.
189
- $this->assertEventError($events->get(0));
190
-
191
- // Should have tried to parse anyway.
192
- $this->assertEventEquals('comment', $result, $events->get(1));
193
- }
194
- }
195
-
196
- public function testComment()
197
- {
198
- $good = array(
199
- '<!--easy-->' => 'easy',
200
- '<!-- 1 > 0 -->' => ' 1 > 0 ',
201
- '<!-- --$i -->' => ' --$i ',
202
- '<!----$i-->' => '--$i',
203
- "<!--\nHello World.\na-->" => "\nHello World.\na",
204
- '<!-- <!-- -->' => ' <!-- ',
205
- );
206
- foreach ($good as $test => $expected) {
207
- $events = $this->parse($test);
208
- $this->assertEventEquals('comment', $expected, $events->get(0));
209
- }
210
-
211
- $fail = array(
212
- '<!-->' => '',
213
- '<!--Hello' => 'Hello',
214
- "<!--\0Hello" => UTF8Utils::FFFD . 'Hello',
215
- '<!--' => '',
216
- );
217
- foreach ($fail as $test => $expected) {
218
- $events = $this->parse($test);
219
- $this->assertEquals(3, $events->depth());
220
- $this->assertEventError($events->get(0));
221
- $this->assertEventEquals('comment', $expected, $events->get(1));
222
- }
223
- }
224
-
225
- public function testCDATASection()
226
- {
227
- $good = array(
228
- '<![CDATA[ This is a test. ]]>' => ' This is a test. ',
229
- '<![CDATA[CDATA]]>' => 'CDATA',
230
- '<![CDATA[ ]] > ]]>' => ' ]] > ',
231
- '<![CDATA[ ]]>' => ' ',
232
- );
233
- $this->isAllGood('cdata', 2, $good);
234
- }
235
-
236
- public function testDoctype()
237
- {
238
- $good = array(
239
- '<!DOCTYPE html>' => array(
240
- 'html',
241
- 0,
242
- null,
243
- false,
244
- ),
245
- '<!doctype html>' => array(
246
- 'html',
247
- 0,
248
- null,
249
- false,
250
- ),
251
- '<!DocType html>' => array(
252
- 'html',
253
- 0,
254
- null,
255
- false,
256
- ),
257
- "<!DOCTYPE\nhtml>" => array(
258
- 'html',
259
- 0,
260
- null,
261
- false,
262
- ),
263
- "<!DOCTYPE\fhtml>" => array(
264
- 'html',
265
- 0,
266
- null,
267
- false,
268
- ),
269
- '<!DOCTYPE html PUBLIC "foo bar">' => array(
270
- 'html',
271
- EventStack::DOCTYPE_PUBLIC,
272
- 'foo bar',
273
- false,
274
- ),
275
- "<!DOCTYPE html PUBLIC 'foo bar'>" => array(
276
- 'html',
277
- EventStack::DOCTYPE_PUBLIC,
278
- 'foo bar',
279
- false,
280
- ),
281
- '<!DOCTYPE html PUBLIC "foo bar" >' => array(
282
- 'html',
283
- EventStack::DOCTYPE_PUBLIC,
284
- 'foo bar',
285
- false,
286
- ),
287
- "<!DOCTYPE html \nPUBLIC\n'foo bar'>" => array(
288
- 'html',
289
- EventStack::DOCTYPE_PUBLIC,
290
- 'foo bar',
291
- false,
292
- ),
293
- '<!DOCTYPE html SYSTEM "foo bar">' => array(
294
- 'html',
295
- EventStack::DOCTYPE_SYSTEM,
296
- 'foo bar',
297
- false,
298
- ),
299
- "<!DOCTYPE html SYSTEM 'foo bar'>" => array(
300
- 'html',
301
- EventStack::DOCTYPE_SYSTEM,
302
- 'foo bar',
303
- false,
304
- ),
305
- '<!DOCTYPE html SYSTEM "foo/bar" >' => array(
306
- 'html',
307
- EventStack::DOCTYPE_SYSTEM,
308
- 'foo/bar',
309
- false,
310
- ),
311
- "<!DOCTYPE html \nSYSTEM\n'foo bar'>" => array(
312
- 'html',
313
- EventStack::DOCTYPE_SYSTEM,
314
- 'foo bar',
315
- false,
316
- ),
317
- );
318
- $this->isAllGood('doctype', 2, $good);
319
-
320
- $bad = array(
321
- '<!DOCTYPE>' => array(
322
- null,
323
- EventStack::DOCTYPE_NONE,
324
- null,
325
- true,
326
- ),
327
- '<!DOCTYPE >' => array(
328
- null,
329
- EventStack::DOCTYPE_NONE,
330
- null,
331
- true,
332
- ),
333
- '<!DOCTYPE foo' => array(
334
- 'foo',
335
- EventStack::DOCTYPE_NONE,
336
- null,
337
- true,
338
- ),
339
- '<!DOCTYPE foo PUB' => array(
340
- 'foo',
341
- EventStack::DOCTYPE_NONE,
342
- null,
343
- true,
344
- ),
345
- '<!DOCTYPE foo PUB>' => array(
346
- 'foo',
347
- EventStack::DOCTYPE_NONE,
348
- null,
349
- true,
350
- ),
351
- '<!DOCTYPE foo PUB "Looks good">' => array(
352
- 'foo',
353
- EventStack::DOCTYPE_NONE,
354
- null,
355
- true,
356
- ),
357
- '<!DOCTYPE foo SYSTME "Looks good"' => array(
358
- 'foo',
359
- EventStack::DOCTYPE_NONE,
360
- null,
361
- true,
362
- ),
363
-
364
- // Can't tell whether these are ids or ID types, since the context is chopped.
365
- '<!DOCTYPE foo PUBLIC' => array(
366
- 'foo',
367
- EventStack::DOCTYPE_NONE,
368
- null,
369
- true,
370
- ),
371
- '<!DOCTYPE foo PUBLIC>' => array(
372
- 'foo',
373
- EventStack::DOCTYPE_NONE,
374
- null,
375
- true,
376
- ),
377
- '<!DOCTYPE foo SYSTEM' => array(
378
- 'foo',
379
- EventStack::DOCTYPE_NONE,
380
- null,
381
- true,
382
- ),
383
- '<!DOCTYPE foo SYSTEM>' => array(
384
- 'foo',
385
- EventStack::DOCTYPE_NONE,
386
- null,
387
- true,
388
- ),
389
-
390
- '<!DOCTYPE html SYSTEM "foo bar"' => array(
391
- 'html',
392
- EventStack::DOCTYPE_SYSTEM,
393
- 'foo bar',
394
- true,
395
- ),
396
- '<!DOCTYPE html SYSTEM "foo bar" more stuff>' => array(
397
- 'html',
398
- EventStack::DOCTYPE_SYSTEM,
399
- 'foo bar',
400
- true,
401
- ),
402
- );
403
- foreach ($bad as $test => $expects) {
404
- $events = $this->parse($test);
405
- // fprintf(STDOUT, $test . PHP_EOL);
406
- $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true));
407
- $this->assertEventError($events->get(0));
408
- $this->assertEventEquals('doctype', $expects, $events->get(1));
409
- }
410
- }
411
-
412
- public function testProcessorInstruction()
413
- {
414
- $good = array(
415
- '<?hph ?>' => 'hph',
416
- '<?hph echo "Hello World"; ?>' => array(
417
- 'hph',
418
- 'echo "Hello World"; ',
419
- ),
420
- "<?hph \necho 'Hello World';\n?>" => array(
421
- 'hph',
422
- "echo 'Hello World';\n",
423
- ),
424
- );
425
- $this->isAllGood('pi', 2, $good);
426
- }
427
-
428
- /**
429
- * This tests just simple tags.
430
- */
431
- public function testSimpleTags()
432
- {
433
- $open = array(
434
- '<foo>' => 'foo',
435
- '<FOO>' => 'foo',
436
- '<fOO>' => 'foo',
437
- '<foo >' => 'foo',
438
- "<foo\n\n\n\n>" => 'foo',
439
- '<foo:bar>' => 'foo:bar',
440
- );
441
- $this->isAllGood('startTag', 2, $open);
442
-
443
- $selfClose = array(
444
- '<foo/>' => 'foo',
445
- '<FOO/>' => 'foo',
446
- '<foo />' => 'foo',
447
- "<foo\n\n\n\n/>" => 'foo',
448
- '<foo:bar/>' => 'foo:bar',
449
- );
450
- foreach ($selfClose as $test => $expects) {
451
- $events = $this->parse($test);
452
- $this->assertEquals(2, $events->depth(), "Counting events for '$test'" . print_r($events, true));
453
- $this->assertEventEquals('startTag', $expects, $events->get(0));
454
- $event = $events->get(0);
455
- $this->assertTrue($event['data'][2]);
456
- }
457
-
458
- $bad = array(
459
- '<foo' => 'foo',
460
- '<foo ' => 'foo',
461
- '<foo/' => 'foo',
462
- '<foo /' => 'foo',
463
- );
464
-
465
- foreach ($bad as $test => $expects) {
466
- $events = $this->parse($test);
467
- $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true));
468
- $this->assertEventError($events->get(0));
469
- $this->assertEventEquals('startTag', $expects, $events->get(1));
470
- }
471
- }
472
-
473
- public function testTagsWithAttributeAndMissingName()
474
- {
475
- $cases = array(
476
- '<id="top_featured">' => 'id',
477
- '<color="white">' => 'color',
478
- "<class='neaktivni_stranka'>" => 'class',
479
- '<bgcolor="white">' => 'bgcolor',
480
- '<class="nom">' => 'class',
481
- );
482
-
483
- foreach ($cases as $html => $expected) {
484
- $events = $this->parse($html);
485
- $this->assertEventError($events->get(0));
486
- $this->assertEventError($events->get(1));
487
- $this->assertEventError($events->get(2));
488
- $this->assertEventEquals('startTag', $expected, $events->get(3));
489
- $this->assertEventEquals('eof', null, $events->get(4));
490
- }
491
- }
492
-
493
- public function testTagNotClosedAfterTagName()
494
- {
495
- $cases = array(
496
- '<noscript<img>' => array(
497
- 'noscript',
498
- 'img',
499
- ),
500
- '<center<a>' => array(
501
- 'center',
502
- 'a',
503
- ),
504
- '<br<br>' => array(
505
- 'br',
506
- 'br',
507
- ),
508
- );
509
-
510
- foreach ($cases as $html => $expected) {
511
- $events = $this->parse($html);
512
- $this->assertEventError($events->get(0));
513
- $this->assertEventEquals('startTag', $expected[0], $events->get(1));
514
- $this->assertEventEquals('startTag', $expected[1], $events->get(2));
515
- $this->assertEventEquals('eof', null, $events->get(3));
516
- }
517
-
518
- $events = $this->parse('<span<>02</span>');
519
- $this->assertEventError($events->get(0));
520
- $this->assertEventEquals('startTag', 'span', $events->get(1));
521
- $this->assertEventError($events->get(2));
522
- $this->assertEventEquals('text', '>02', $events->get(3));
523
- $this->assertEventEquals('endTag', 'span', $events->get(4));
524
- $this->assertEventEquals('eof', null, $events->get(5));
525
-
526
- $events = $this->parse('<p</p>');
527
- $this->assertEventError($events->get(0));
528
- $this->assertEventEquals('startTag', 'p', $events->get(1));
529
- $this->assertEventEquals('endTag', 'p', $events->get(2));
530
- $this->assertEventEquals('eof', null, $events->get(3));
531
-
532
- $events = $this->parse('<strong><WordPress</strong>');
533
- $this->assertEventEquals('startTag', 'strong', $events->get(0));
534
- $this->assertEventError($events->get(1));
535
- $this->assertEventEquals('startTag', 'wordpress', $events->get(2));
536
- $this->assertEventEquals('endTag', 'strong', $events->get(3));
537
- $this->assertEventEquals('eof', null, $events->get(4));
538
-
539
- $events = $this->parse('<src=<a>');
540
- $this->assertEventError($events->get(0));
541
- $this->assertEventError($events->get(1));
542
- $this->assertEventError($events->get(2));
543
- $this->assertEventEquals('startTag', 'src', $events->get(3));
544
- $this->assertEventEquals('startTag', 'a', $events->get(4));
545
- $this->assertEventEquals('eof', null, $events->get(5));
546
-
547
- $events = $this->parse('<br...<a>');
548
- $this->assertEventError($events->get(0));
549
- $this->assertEventEquals('startTag', 'br', $events->get(1));
550
- $this->assertEventEquals('eof', null, $events->get(2));
551
- }
552
-
553
- public function testIllegalTagNames()
554
- {
555
- $cases = array(
556
- '<li">' => 'li',
557
- '<p">' => 'p',
558
- '<b&nbsp; >' => 'b',
559
- '<static*all>' => 'static',
560
- '<h*0720/>' => 'h',
561
- '<st*ATTRIBUTE />' => 'st',
562
- );
563
-
564
- foreach ($cases as $html => $expected) {
565
- $events = $this->parse($html);
566
- $this->assertEventError($events->get(0));
567
- $this->assertEventEquals('startTag', $expected, $events->get(1));
568
- }
569
- }
570
-
571
- /**
572
- * @depends testCharacterReference
573
- */
574
- public function testTagAttributes()
575
- {
576
- // Opening tags.
577
- $good = array(
578
- '<foo bar="baz">' => array(
579
- 'foo',
580
- array(
581
- 'bar' => 'baz',
582
- ),
583
- false,
584
- ),
585
- '<foo bar=" baz ">' => array(
586
- 'foo',
587
- array(
588
- 'bar' => ' baz ',
589
- ),
590
- false,
591
- ),
592
- "<foo bar=\"\nbaz\n\">" => array(
593
- 'foo',
594
- array(
595
- 'bar' => "\nbaz\n",
596
- ),
597
- false,
598
- ),
599
- "<foo bar='baz'>" => array(
600
- 'foo',
601
- array(
602
- 'bar' => 'baz',
603
- ),
604
- false,
605
- ),
606
- '<foo bar="A full sentence.">' => array(
607
- 'foo',
608
- array(
609
- 'bar' => 'A full sentence.',
610
- ),
611
- false,
612
- ),
613
- "<foo a='1' b=\"2\">" => array(
614
- 'foo',
615
- array(
616
- 'a' => '1',
617
- 'b' => '2',
618
- ),
619
- false,
620
- ),
621
- "<foo ns:bar='baz'>" => array(
622
- 'foo',
623
- array(
624
- 'ns:bar' => 'baz',
625
- ),
626
- false,
627
- ),
628
- "<foo a='blue&red'>" => array(
629
- 'foo',
630
- array(
631
- 'a' => 'blue&red',
632
- ),
633
- false,
634
- ),
635
- "<foo a='blue&amp;red'>" => array(
636
- 'foo',
637
- array(
638
- 'a' => 'blue&red',
639
- ),
640
- false,
641
- ),
642
- "<foo a='blue&&amp;&red'>" => array(
643
- 'foo',
644
- array(
645
- 'a' => 'blue&&&red',
646
- ),
647
- false,
648
- ),
649
- "<foo a='blue&&amp;red'>" => array(
650
- 'foo',
651
- array(
652
- 'a' => 'blue&&red',
653
- ),
654
- false,
655
- ),
656
- "<foo\nbar='baz'\n>" => array(
657
- 'foo',
658
- array(
659
- 'bar' => 'baz',
660
- ),
661
- false,
662
- ),
663
- '<doe a deer>' => array(
664
- 'doe',
665
- array(
666
- 'a' => null,
667
- 'deer' => null,
668
- ),
669
- false,
670
- ),
671
- '<foo bar=baz>' => array(
672
- 'foo',
673
- array(
674
- 'bar' => 'baz',
675
- ),
676
- false,
677
- ),
678
-
679
- // Updated for 8.1.2.3
680
- '<foo bar = "baz" >' => array(
681
- 'foo',
682
- array(
683
- 'bar' => 'baz',
684
- ),
685
- false,
686
- ),
687
-
688
- // The spec allows an unquoted value '/'. This will not be a closing
689
- // tag.
690
- '<foo bar=/>' => array(
691
- 'foo',
692
- array(
693
- 'bar' => '/',
694
- ),
695
- false,
696
- ),
697
- '<foo bar=baz/>' => array(
698
- 'foo',
699
- array(
700
- 'bar' => 'baz/',
701
- ),
702
- false,
703
- ),
704
- );
705
- $this->isAllGood('startTag', 2, $good);
706
-
707
- // Self-closing tags.
708
- $withEnd = array(
709
- '<foo bar="baz"/>' => array(
710
- 'foo',
711
- array(
712
- 'bar' => 'baz',
713
- ),
714
- true,
715
- ),
716
- '<foo BAR="baz"/>' => array(
717
- 'foo',
718
- array(
719
- 'bar' => 'baz',
720
- ),
721
- true,
722
- ),
723
- '<foo BAR="BAZ"/>' => array(
724
- 'foo',
725
- array(
726
- 'bar' => 'BAZ',
727
- ),
728
- true,
729
- ),
730
- "<foo a='1' b=\"2\" c=3 d/>" => array(
731
- 'foo',
732
- array(
733
- 'a' => '1',
734
- 'b' => '2',
735
- 'c' => '3',
736
- 'd' => null,
737
- ),
738
- true,
739
- ),
740
- );
741
- $this->isAllGood('startTag', 2, $withEnd);
742
-
743
- // Cause a parse error.
744
- $bad = array(
745
- // This will emit an entity lookup failure for &+dark.
746
- "<foo a='blue&+dark'>" => array(
747
- 'foo',
748
- array(
749
- 'a' => 'blue&+dark',
750
- ),
751
- false,
752
- ),
753
- '<foo bar=>' => array(
754
- 'foo',
755
- array(
756
- 'bar' => null,
757
- ),
758
- false,
759
- ),
760
- '<foo bar="oh' => array(
761
- 'foo',
762
- array(
763
- 'bar' => 'oh',
764
- ),
765
- false,
766
- ),
767
- '<foo bar=oh">' => array(
768
- 'foo',
769
- array(
770
- 'bar' => 'oh"',
771
- ),
772
- false,
773
- ),
774
-
775
- // these attributes are ignored because of current implementation
776
- // of method "DOMElement::setAttribute"
777
- // see issue #23: https://github.com/Masterminds/html5-php/issues/23
778
- '<foo b"="baz">' => array(
779
- 'foo',
780
- array(),
781
- false,
782
- ),
783
- '<foo 2abc="baz">' => array(
784
- 'foo',
785
- array(),
786
- false,
787
- ),
788
- '<foo ?="baz">' => array(
789
- 'foo',
790
- array(),
791
- false,
792
- ),
793
- '<foo foo?bar="baz">' => array(
794
- 'foo',
795
- array(),
796
- false,
797
- ),
798
- )
799
- ;
800
- foreach ($bad as $test => $expects) {
801
- $events = $this->parse($test);
802
- $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true));
803
- $this->assertEventError($events->get(0));
804
- $this->assertEventEquals('startTag', $expects, $events->get(1));
805
- }
806
-
807
- // Cause multiple parse errors.
808
- $reallyBad = array(
809
- '<foo ="bar">' => array(
810
- 'foo',
811
- array(
812
- '=' => null,
813
- '"bar"' => null,
814
- ),
815
- false,
816
- ),
817
- '<foo////>' => array(
818
- 'foo',
819
- array(),
820
- true,
821
- ),
822
- // character "&" in unquoted attribute shouldn't cause an infinite loop
823
- '<foo bar=index.php?str=1&amp;id=29>' => array(
824
- 'foo',
825
- array(
826
- 'bar' => 'index.php?str=1&id=29',
827
- ),
828
- false,
829
- ),
830
- );
831
- foreach ($reallyBad as $test => $expects) {
832
- $events = $this->parse($test);
833
- // fprintf(STDOUT, $test . print_r($events, true));
834
- $this->assertEventError($events->get(0));
835
- $this->assertEventError($events->get(1));
836
- // $this->assertEventEquals('startTag', $expects, $events->get(1));
837
- }
838
-
839
- // Regression: Malformed elements should be detected.
840
- // '<foo baz="1" <bar></foo>' => array('foo', array('baz' => '1'), false),
841
- $events = $this->parse('<foo baz="1" <bar></foo>');
842
- $this->assertEventError($events->get(0));
843
- $this->assertEventEquals('startTag', array(
844
- 'foo',
845
- array(
846
- 'baz' => '1',
847
- ),
848
- false,
849
- ), $events->get(1));
850
- $this->assertEventEquals('startTag', array(
851
- 'bar',
852
- array(),
853
- false,
854
- ), $events->get(2));
855
- $this->assertEventEquals('endTag', array(
856
- 'foo',
857
- ), $events->get(3));
858
- }
859
-
860
- public function testRawText()
861
- {
862
- $good = array(
863
- '<script>abcd efg hijk lmnop</script> ' => 'abcd efg hijk lmnop',
864
- '<script><not/><the/><tag></script>' => '<not/><the/><tag>',
865
- '<script><<<<<<<<</script>' => '<<<<<<<<',
866
- '<script>hello</script</script>' => 'hello</script',
867
- "<script>\nhello</script\n</script>" => "\nhello</script\n",
868
- '<script>&amp;</script>' => '&amp;',
869
- '<script><!--not a comment--></script>' => '<!--not a comment-->',
870
- '<script><![CDATA[not a comment]]></script>' => '<![CDATA[not a comment]]>',
871
- );
872
- foreach ($good as $test => $expects) {
873
- $events = $this->parse($test);
874
- $this->assertEventEquals('startTag', 'script', $events->get(0));
875
- $this->assertEventEquals('text', $expects, $events->get(1));
876
- $this->assertEventEquals('endTag', 'script', $events->get(2));
877
- }
878
-
879
- $bad = array(
880
- '<script>&amp;</script' => '&amp;</script',
881
- '<script>Hello world' => 'Hello world',
882
- );
883
- foreach ($bad as $test => $expects) {
884
- $events = $this->parse($test);
885
- $this->assertEquals(4, $events->depth(), "Counting events for '$test': " . print_r($events, true));
886
- $this->assertEventEquals('startTag', 'script', $events->get(0));
887
- $this->assertEventError($events->get(1));
888
- $this->assertEventEquals('text', $expects, $events->get(2));
889
- }
890
-
891
- // Testing case sensitivity
892
- $events = $this->parse('<TITLE>a test</TITLE>');
893
- $this->assertEventEquals('startTag', 'title', $events->get(0));
894
- $this->assertEventEquals('text', 'a test', $events->get(1));
895
- $this->assertEventEquals('endTag', 'title', $events->get(2));
896
-
897
- // Testing end tags with whitespaces
898
- $events = $this->parse('<title>Whitespaces are tasty</title >');
899
- $this->assertEventEquals('startTag', 'title', $events->get(0));
900
- $this->assertEventEquals('text', 'Whitespaces are tasty', $events->get(1));
901
- $this->assertEventEquals('endTag', 'title', $events->get(2));
902
- }
903
-
904
- public function testRcdata()
905
- {
906
- list($tok, $events) = $this->createTokenizer('<title>&#x27;<!-- not a comment --></TITLE>');
907
- $tok->setTextMode(\Masterminds\HTML5\Elements::TEXT_RCDATA, 'title');
908
- $tok->parse();
909
- $this->assertEventEquals('text', "'<!-- not a comment -->", $events->get(1));
910
- }
911
-
912
- public function testText()
913
- {
914
- $events = $this->parse('a<br>b');
915
- $this->assertEquals(4, $events->depth(), 'Events: ' . print_r($events, true));
916
- $this->assertEventEquals('text', 'a', $events->get(0));
917
- $this->assertEventEquals('startTag', 'br', $events->get(1));
918
- $this->assertEventEquals('text', 'b', $events->get(2));
919
-
920
- $events = $this->parse('<a>Test</a>');
921
- $this->assertEquals(4, $events->depth(), 'Events: ' . print_r($events, true));
922
- $this->assertEventEquals('startTag', 'a', $events->get(0));
923
- $this->assertEventEquals('text', 'Test', $events->get(1));
924
- $this->assertEventEquals('endTag', 'a', $events->get(2));
925
-
926
- $events = $this->parse('<p>0</p><p>1</p>');
927
- $this->assertEquals(7, $events->depth(), 'Events: ' . print_r($events, true));
928
-
929
- $this->assertEventEquals('startTag', 'p', $events->get(0));
930
- $this->assertEventEquals('text', '0', $events->get(1));
931
- $this->assertEventEquals('endTag', 'p', $events->get(2));
932
-
933
- $this->assertEventEquals('startTag', 'p', $events->get(3));
934
- $this->assertEventEquals('text', '1', $events->get(4));
935
- $this->assertEventEquals('endTag', 'p', $events->get(5));
936
-
937
- $events = $this->parse('a<![CDATA[test]]>b');
938
- $this->assertEquals(4, $events->depth(), 'Events: ' . print_r($events, true));
939
- $this->assertEventEquals('text', 'a', $events->get(0));
940
- $this->assertEventEquals('cdata', 'test', $events->get(1));
941
- $this->assertEventEquals('text', 'b', $events->get(2));
942
-
943
- $events = $this->parse('a<!--test-->b');
944
- $this->assertEquals(4, $events->depth(), 'Events: ' . print_r($events, true));
945
- $this->assertEventEquals('text', 'a', $events->get(0));
946
- $this->assertEventEquals('comment', 'test', $events->get(1));
947
- $this->assertEventEquals('text', 'b', $events->get(2));
948
-
949
- $events = $this->parse('a&amp;b');
950
- $this->assertEquals(2, $events->depth(), 'Events: ' . print_r($events, true));
951
- $this->assertEventEquals('text', 'a&b', $events->get(0));
952
-
953
- $events = $this->parse('a&sup2;b');
954
- $this->assertEquals(2, $events->depth(), 'Events: ' . print_r($events, true));
955
- $this->assertEventEquals('text', 'a²b', $events->get(0));
956
- }
957
-
958
- // ================================================================
959
- // Utility functions.
960
- // ================================================================
961
- protected function createTokenizer($string, $debug = false)
962
- {
963
- $eventHandler = new EventStack();
964
- $scanner = new Scanner($string);
965
-
966
- $scanner->debug = $debug;
967
-
968
- return array(
969
- new Tokenizer($scanner, $eventHandler),
970
- $eventHandler,
971
- );
972
- }
973
-
974
- public function parse($string, $debug = false)
975
- {
976
- list($tok, $events) = $this->createTokenizer($string, $debug);
977
- $tok->parse();
978
-
979
- return $events;
980
- }
981
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/TreeBuildingRulesTest.php DELETED
@@ -1,118 +0,0 @@
1
- <?php
2
- /**
3
- * @file
4
- * Test the Tree Builder's special-case rules.
5
- */
6
-
7
- namespace Masterminds\HTML5\Tests\Parser;
8
-
9
- use Masterminds\HTML5\Parser\TreeBuildingRules;
10
- use Masterminds\HTML5\Parser\Tokenizer;
11
- use Masterminds\HTML5\Parser\Scanner;
12
- use Masterminds\HTML5\Parser\DOMTreeBuilder;
13
-
14
- /**
15
- * These tests are functional, not necessarily unit tests.
16
- */
17
- class TreeBuildingRulesTest extends \Masterminds\HTML5\Tests\TestCase
18
- {
19
- const HTML_STUB = '<!DOCTYPE html><html><head><title>test</title></head><body>%s</body></html>';
20
-
21
- /**
22
- * Convenience function for parsing.
23
- */
24
- protected function parse($string)
25
- {
26
- $treeBuilder = new DOMTreeBuilder();
27
- $scanner = new Scanner($string);
28
- $parser = new Tokenizer($scanner, $treeBuilder);
29
-
30
- $parser->parse();
31
-
32
- return $treeBuilder->document();
33
- }
34
-
35
- /**
36
- * Convenience function for parsing fragments.
37
- */
38
- protected function parseFragment($string)
39
- {
40
- $events = new DOMTreeBuilder(true);
41
- $scanner = new Scanner($string);
42
- $parser = new Tokenizer($scanner, $events);
43
-
44
- $parser->parse();
45
-
46
- return $events->fragment();
47
- }
48
-
49
- public function testTDFragment()
50
- {
51
- $frag = $this->parseFragment('<td>This is a test of the HTML5 parser</td>');
52
-
53
- $td = $frag->childNodes->item(0);
54
-
55
- $this->assertEquals(1, $frag->childNodes->length);
56
- $this->assertEquals('td', $td->tagName);
57
- $this->assertEquals('This is a test of the HTML5 parser', $td->nodeValue);
58
- }
59
-
60
- public function testHasRules()
61
- {
62
- $doc = new \DOMDocument('1.0');
63
- $engine = new TreeBuildingRules($doc);
64
-
65
- $this->assertTrue($engine->hasRules('li'));
66
- $this->assertFalse($engine->hasRules('imaginary'));
67
- }
68
-
69
- public function testHandleLI()
70
- {
71
- $html = sprintf(self::HTML_STUB, '<ul id="a"><li>test<li>test2</ul><a></a>');
72
- $doc = $this->parse($html);
73
-
74
- $list = $doc->getElementById('a');
75
-
76
- $this->assertEquals(2, $list->childNodes->length);
77
- foreach ($list->childNodes as $ele) {
78
- $this->assertEquals('li', $ele->tagName);
79
- }
80
- }
81
-
82
- public function testHandleDT()
83
- {
84
- $html = sprintf(self::HTML_STUB, '<dl id="a"><dt>Hello<dd>Hi</dl><a></a>');
85
- $doc = $this->parse($html);
86
-
87
- $list = $doc->getElementById('a');
88
-
89
- $this->assertEquals(2, $list->childNodes->length);
90
- $this->assertEquals('dt', $list->firstChild->tagName);
91
- $this->assertEquals('dd', $list->lastChild->tagName);
92
- }
93
-
94
- public function testHandleOptionGroupAndOption()
95
- {
96
- $html = sprintf(self::HTML_STUB, '<optgroup id="foo" label="foo" ><option value="foo">bar</option></optgroup>');
97
- $doc = $this->parse($html);
98
-
99
- $list = $doc->getElementById('foo');
100
-
101
- $this->assertEquals(1, $list->childNodes->length);
102
-
103
- $option = $list->childNodes->item(0);
104
- $this->assertEquals('option', $option->tagName);
105
- }
106
-
107
- public function testTable()
108
- {
109
- $html = sprintf(self::HTML_STUB, '<table><thead id="a"><th>foo<td>bar<td>baz');
110
- $doc = $this->parse($html);
111
-
112
- $list = $doc->getElementById('a');
113
-
114
- $this->assertEquals(3, $list->childNodes->length);
115
- $this->assertEquals('th', $list->firstChild->tagName);
116
- $this->assertEquals('td', $list->lastChild->tagName);
117
- }
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests\Parser;
4
-
5
- use Masterminds\HTML5\Parser\UTF8Utils;
6
-
7
- class UTF8UtilsTest extends \Masterminds\HTML5\Tests\TestCase
8
- {
9
- public function testConvertToUTF8()
10
- {
11
- $out = UTF8Utils::convertToUTF8('éàa', 'ISO-8859-1');
12
- $this->assertEquals('éàa', $out);
13
- }
14
-
15
- /**
16
- * @todo add tests for invalid codepoints
17
- */
18
- public function testCheckForIllegalCodepoints()
19
- {
20
- $smoke = 'Smoke test';
21
- $err = UTF8Utils::checkForIllegalCodepoints($smoke);
22
- $this->assertEmpty($err);
23
-
24
- $data = "Foo Bar \0 Baz";
25
- $errors = UTF8Utils::checkForIllegalCodepoints($data);
26
- $this->assertContains('null-character', $errors);
27
- }
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Serializer/OutputRulesTest.php DELETED
@@ -1,652 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests\Serializer;
4
-
5
- use Masterminds\HTML5\Serializer\OutputRules;
6
- use Masterminds\HTML5\Serializer\Traverser;
7
- use Masterminds\HTML5;
8
-
9
- class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
10
- {
11
- protected $markup = '<!doctype html>
12
- <html lang="en">
13
- <head>
14
- <meta charset="utf-8">
15
- <title>Test</title>
16
- </head>
17
- <body>
18
- <p>This is a test.</p>
19
- </body>
20
- </html>';
21
-
22
- /**
23
- * @var HTML5
24
- */
25
- protected $html5;
26
-
27
- public function setUp()
28
- {
29
- $this->html5 = $this->getInstance();
30
- }
31
-
32
- /**
33
- * Using reflection we make a protected method accessible for testing.
34
- *
35
- * @param string $name
36
- * The name of the method on the Traverser class to test
37
- *
38
- * @return \ReflectionMethod for the specified method
39
- */
40
- public function getProtectedMethod($name)
41
- {
42
- $class = new \ReflectionClass('\Masterminds\HTML5\Serializer\OutputRules');
43
- $method = $class->getMethod($name);
44
- $method->setAccessible(true);
45
-
46
- return $method;
47
- }
48
-
49
- public function getTraverserProtectedProperty($name)
50
- {
51
- $class = new \ReflectionClass('\Masterminds\HTML5\Serializer\Traverser');
52
- $property = $class->getProperty($name);
53
- $property->setAccessible(true);
54
-
55
- return $property;
56
- }
57
-
58
- public function getOutputRules($options = array())
59
- {
60
- $options = $options + $this->html5->getOptions();
61
- $stream = fopen('php://temp', 'w');
62
- $dom = $this->html5->loadHTML($this->markup);
63
- $r = new OutputRules($stream, $options);
64
- $t = new Traverser($dom, $stream, $r, $options);
65
-
66
- return array(
67
- $r,
68
- $stream,
69
- );
70
- }
71
-
72
- public function testDocument()
73
- {
74
- $dom = $this->html5->loadHTML('<!doctype html><html lang="en"><body>foo</body></html>');
75
-
76
- $stream = fopen('php://temp', 'w');
77
- $r = new OutputRules($stream, $this->html5->getOptions());
78
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
79
-
80
- $r->document($dom);
81
- $expected = '<!DOCTYPE html>' . PHP_EOL . '<html lang="en"><body>foo</body></html>' . PHP_EOL;
82
- $this->assertEquals($expected, stream_get_contents($stream, -1, 0));
83
- }
84
-
85
- public function testEmptyDocument()
86
- {
87
- $dom = $this->html5->loadHTML('');
88
-
89
- $stream = fopen('php://temp', 'w');
90
- $r = new OutputRules($stream, $this->html5->getOptions());
91
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
92
-
93
- $r->document($dom);
94
- $expected = '<!DOCTYPE html>' . PHP_EOL;
95
- $this->assertEquals($expected, stream_get_contents($stream, -1, 0));
96
- }
97
-
98
- public function testDoctype()
99
- {
100
- $dom = $this->html5->loadHTML('<!doctype html><html lang="en"><body>foo</body></html>');
101
-
102
- $stream = fopen('php://temp', 'w');
103
- $r = new OutputRules($stream, $this->html5->getOptions());
104
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
105
-
106
- $m = $this->getProtectedMethod('doctype');
107
- $m->invoke($r, 'foo');
108
- $this->assertEquals('<!DOCTYPE html>' . PHP_EOL, stream_get_contents($stream, -1, 0));
109
- }
110
-
111
- public function testElement()
112
- {
113
- $dom = $this->html5->loadHTML(
114
- '<!doctype html>
115
- <html lang="en">
116
- <body>
117
- <div id="foo" class="bar baz">foo bar baz</div>
118
- <svg width="150" height="100" viewBox="0 0 3 2">
119
- <rect width="1" height="2" x="0" fill="#008d46" />
120
- <rect width="1" height="2" x="1" fill="#ffffff" />
121
- <rect width="1" height="2" x="2" fill="#d2232c" />
122
- </svg>
123
- </body>
124
- </html>');
125
-
126
- $stream = fopen('php://temp', 'w');
127
- $r = new OutputRules($stream, $this->html5->getOptions());
128
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
129
-
130
- $list = $dom->getElementsByTagName('div');
131
- $r->element($list->item(0));
132
- $this->assertEquals('<div id="foo" class="bar baz">foo bar baz</div>', stream_get_contents($stream, -1, 0));
133
- }
134
-
135
- public function testSerializeWithNamespaces()
136
- {
137
- $this->html5 = $this->getInstance(array(
138
- 'xmlNamespaces' => true,
139
- ));
140
-
141
- $source = '
142
- <!DOCTYPE html>
143
- <html><body id="body" xmlns:x="http://www.prefixed.com">
144
- <a id="bar1" xmlns="http://www.prefixed.com/bar1">
145
- <b id="bar4" xmlns="http://www.prefixed.com/bar4"><x:prefixed id="prefixed">xy</x:prefixed></b>
146
- </a>
147
- <svg id="svg">svg</svg>
148
- <c id="bar2" xmlns="http://www.prefixed.com/bar2"></c>
149
- <div id="div"></div>
150
- <d id="bar3"></d>
151
- <xn:d id="bar5" xmlns:xn="http://www.prefixed.com/xn" xmlns="http://www.prefixed.com/bar5_x"><x id="bar5_x">y</x></xn:d>
152
- </body>
153
- </html>';
154
-
155
- $dom = $this->html5->loadHTML($source, array(
156
- 'xmlNamespaces' => true,
157
- ));
158
- $this->assertFalse($this->html5->hasErrors(), print_r($this->html5->getErrors(), 1));
159
-
160
- $stream = fopen('php://temp', 'w');
161
- $r = new OutputRules($stream, $this->html5->getOptions());
162
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
163
-
164
- $t->walk();
165
- $rendered = stream_get_contents($stream, -1, 0);
166
-
167
- $clear = function ($s) {
168
- return trim(preg_replace('/[\s]+/', ' ', $s));
169
- };
170
-
171
- $this->assertEquals($clear($source), $clear($rendered));
172
- }
173
-
174
- public function testElementWithScript()
175
- {
176
- $dom = $this->html5->loadHTML(
177
- '<!doctype html>
178
- <html lang="en">
179
- <head>
180
- <script>
181
- var $jQ = jQuery.noConflict();
182
- // Use jQuery via $jQ(...)
183
- $jQ(document).ready(function () {
184
- $jQ("#mktFrmSubmit").wrap("<div class=\'buttonSubmit\'></div>");
185
- $jQ(".buttonSubmit").prepend("<span></span>");
186
- });
187
- </script>
188
- </head>
189
- <body>
190
- <div id="foo" class="bar baz">foo bar baz</div>
191
- </body>
192
- </html>');
193
-
194
- $stream = fopen('php://temp', 'w');
195
- $r = new OutputRules($stream, $this->html5->getOptions());
196
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
197
-
198
- $script = $dom->getElementsByTagName('script');
199
- $r->element($script->item(0));
200
- $this->assertEquals(
201
- '<script>
202
- var $jQ = jQuery.noConflict();
203
- // Use jQuery via $jQ(...)
204
- $jQ(document).ready(function () {
205
- $jQ("#mktFrmSubmit").wrap("<div class=\'buttonSubmit\'></div>");
206
- $jQ(".buttonSubmit").prepend("<span></span>");
207
- });
208
- </script>', stream_get_contents($stream, -1, 0));
209
- }
210
-
211
- public function testElementWithStyle()
212
- {
213
- $dom = $this->html5->loadHTML(
214
- '<!doctype html>
215
- <html lang="en">
216
- <head>
217
- <style>
218
- body > .bar {
219
- display: none;
220
- }
221
- </style>
222
- </head>
223
- <body>
224
- <div id="foo" class="bar baz">foo bar baz</div>
225
- </body>
226
- </html>');
227
-
228
- $stream = fopen('php://temp', 'w');
229
- $r = new OutputRules($stream, $this->html5->getOptions());
230
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
231
-
232
- $style = $dom->getElementsByTagName('style');
233
- $r->element($style->item(0));
234
- $this->assertEquals('<style>
235
- body > .bar {
236
- display: none;
237
- }
238
- </style>', stream_get_contents($stream, -1, 0));
239
- }
240
-
241
- public function testOpenTag()
242
- {
243
- $dom = $this->html5->loadHTML('<!doctype html>
244
- <html lang="en">
245
- <body>
246
- <div id="foo" class="bar baz">foo bar baz</div>
247
- </body>
248
- </html>');
249
-
250
- $stream = fopen('php://temp', 'w');
251
- $r = new OutputRules($stream, $this->html5->getOptions());
252
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
253
-
254
- $list = $dom->getElementsByTagName('div');
255
- $m = $this->getProtectedMethod('openTag');
256
- $m->invoke($r, $list->item(0));
257
- $this->assertEquals('<div id="foo" class="bar baz">', stream_get_contents($stream, -1, 0));
258
- }
259
-
260
- public function testCData()
261
- {
262
- $dom = $this->html5->loadHTML('<!doctype html>
263
- <html lang="en">
264
- <body>
265
- <div><![CDATA[bar]]></div>
266
- </body>
267
- </html>');
268
-
269
- $stream = fopen('php://temp', 'w');
270
- $r = new OutputRules($stream, $this->html5->getOptions());
271
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
272
-
273
- $list = $dom->getElementsByTagName('div');
274
- $r->cdata($list->item(0)->childNodes->item(0));
275
- $this->assertEquals('<![CDATA[bar]]>', stream_get_contents($stream, -1, 0));
276
-
277
- $dom = $this->html5->loadHTML('<!doctype html>
278
- <html lang="en">
279
- <body>
280
- <div id="foo"></div>
281
- </body>
282
- </html>');
283
-
284
- $dom->getElementById('foo')->appendChild(new \DOMCdataSection(']]>Foo<[![CDATA test ]]>'));
285
-
286
- $stream = fopen('php://temp', 'w');
287
- $r = new OutputRules($stream, $this->html5->getOptions());
288
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
289
- $list = $dom->getElementsByTagName('div');
290
- $r->cdata($list->item(0)->childNodes->item(0));
291
-
292
- $this->assertEquals('<![CDATA[]]]]><![CDATA[>Foo<[![CDATA test ]]]]><![CDATA[>]]>', stream_get_contents($stream, -1, 0));
293
- }
294
-
295
- public function testComment()
296
- {
297
- $dom = $this->html5->loadHTML('<!doctype html>
298
- <html lang="en">
299
- <body>
300
- <div><!-- foo --></div>
301
- </body>
302
- </html>');
303
-
304
- $stream = fopen('php://temp', 'w');
305
- $r = new OutputRules($stream, $this->html5->getOptions());
306
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
307
-
308
- $list = $dom->getElementsByTagName('div');
309
- $r->comment($list->item(0)->childNodes->item(0));
310
- $this->assertEquals('<!-- foo -->', stream_get_contents($stream, -1, 0));
311
-
312
- $dom = $this->html5->loadHTML('<!doctype html>
313
- <html lang="en">
314
- <body>
315
- <div id="foo"></div>
316
- </body>
317
- </html>');
318
- $dom->getElementById('foo')->appendChild(new \DOMComment('<!-- --> --> Foo -->'));
319
-
320
- $stream = fopen('php://temp', 'w');
321
- $r = new OutputRules($stream, $this->html5->getOptions());
322
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
323
-
324
- $list = $dom->getElementsByTagName('div');
325
- $r->comment($list->item(0)->childNodes->item(0));
326
-
327
- // Could not find more definitive guidelines on what this should be. Went with
328
- // what the HTML5 spec says and what \DOMDocument::saveXML() produces.
329
- $this->assertEquals('<!--<!-- --> --> Foo -->-->', stream_get_contents($stream, -1, 0));
330
- }
331
-
332
- public function testText()
333
- {
334
- $dom = $this->html5->loadHTML('<!doctype html>
335
- <html lang="en">
336
- <head>
337
- <script>baz();</script>
338
- </head>
339
- </html>');
340
-
341
- $stream = fopen('php://temp', 'w');
342
- $r = new OutputRules($stream, $this->html5->getOptions());
343
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
344
-
345
- $list = $dom->getElementsByTagName('script');
346
- $r->text($list->item(0)->childNodes->item(0));
347
- $this->assertEquals('baz();', stream_get_contents($stream, -1, 0));
348
-
349
- $dom = $this->html5->loadHTML('<!doctype html>
350
- <html lang="en">
351
- <head id="foo"></head>
352
- </html>');
353
- $foo = $dom->getElementById('foo');
354
- $foo->appendChild(new \DOMText('<script>alert("hi");</script>'));
355
-
356
- $stream = fopen('php://temp', 'w');
357
- $r = new OutputRules($stream, $this->html5->getOptions());
358
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
359
-
360
- $r->text($foo->firstChild);
361
- $this->assertEquals('&lt;script&gt;alert("hi");&lt;/script&gt;', stream_get_contents($stream, -1, 0));
362
- }
363
-
364
- public function testNl()
365
- {
366
- list($o, $s) = $this->getOutputRules();
367
-
368
- $m = $this->getProtectedMethod('nl');
369
- $m->invoke($o);
370
- $this->assertEquals(PHP_EOL, stream_get_contents($s, -1, 0));
371
- }
372
-
373
- public function testWr()
374
- {
375
- list($o, $s) = $this->getOutputRules();
376
-
377
- $m = $this->getProtectedMethod('wr');
378
- $m->invoke($o, 'foo');
379
- $this->assertEquals('foo', stream_get_contents($s, -1, 0));
380
- }
381
-
382
- public function getEncData()
383
- {
384
- return array(
385
- array(
386
- false,
387
- '&\'<>"',
388
- '&amp;\'&lt;&gt;"',
389
- '&amp;&apos;&lt;&gt;&quot;',
390
- ),
391
- array(
392
- false,
393
- 'This + is. a < test',
394
- 'This + is. a &lt; test',
395
- 'This &plus; is&period; a &lt; test',
396
- ),
397
- array(
398
- false,
399
- '.+#',
400
- '.+#',
401
- '&period;&plus;&num;',
402
- ),
403
-
404
- array(
405
- true,
406
- '.+#\'',
407
- '.+#\'',
408
- '&period;&plus;&num;&apos;',
409
- ),
410
- array(
411
- true,
412
- '&".<',
413
- '&amp;&quot;.<',
414
- '&amp;&quot;&period;&lt;',
415
- ),
416
- array(
417
- true,
418
- '&\'<>"',
419
- '&amp;\'<>&quot;',
420
- '&amp;&apos;&lt;&gt;&quot;',
421
- ),
422
- array(
423
- true,
424
- "\xc2\xa0\"'",
425
- '&nbsp;&quot;\'',
426
- '&nbsp;&quot;&apos;',
427
- ),
428
- );
429
- }
430
-
431
- /**
432
- * Test basic encoding of text.
433
- *
434
- * @dataProvider getEncData
435
- */
436
- public function testEnc($isAttribute, $test, $expected, $expectedEncoded)
437
- {
438
- list($o, $s) = $this->getOutputRules();
439
- $m = $this->getProtectedMethod('enc');
440
-
441
- $this->assertEquals($expected, $m->invoke($o, $test, $isAttribute));
442
-
443
- list($o, $s) = $this->getOutputRules(array(
444
- 'encode_entities' => true,
445
- ));
446
- $m = $this->getProtectedMethod('enc');
447
- $this->assertEquals($expectedEncoded, $m->invoke($o, $test, $isAttribute));
448
- }
449
-
450
- /**
451
- * Test basic encoding of text.
452
- *
453
- * @dataProvider getEncData
454
- */
455
- public function testEscape($isAttribute, $test, $expected, $expectedEncoded)
456
- {
457
- list($o, $s) = $this->getOutputRules();
458
- $m = $this->getProtectedMethod('escape');
459
-
460
- $this->assertEquals($expected, $m->invoke($o, $test, $isAttribute));
461
- }
462
-
463
- public function booleanAttributes()
464
- {
465
- return array(
466
- array('<img alt="" ismap>'),
467
- array('<img alt="">'),
468
- array('<input type="radio" readonly>'),
469
- array('<input type="radio" checked disabled>'),
470
- array('<input type="checkbox" checked disabled>'),
471
- array('<input type="radio" value="" checked disabled>'),
472
- array('<div data-value=""></div>'),
473
- array('<select disabled></select>'),
474
- array('<div ng-app></div>'),
475
- array('<script defer></script>'),
476
- );
477
- }
478
-
479
- /**
480
- * @dataProvider booleanAttributes
481
- */
482
- public function testBooleanAttrs($html)
483
- {
484
- $dom = $this->html5->loadHTML('<!doctype html><html lang="en"><body>' . $html . '</body></html>');
485
-
486
- $stream = fopen('php://temp', 'w');
487
- $r = new OutputRules($stream, $this->html5->getOptions());
488
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
489
-
490
- $node = $dom->getElementsByTagName('body')->item(0)->firstChild;
491
-
492
- $m = $this->getProtectedMethod('attrs');
493
- $m->invoke($r, $node);
494
-
495
- $content = stream_get_contents($stream, -1, 0);
496
-
497
- $html = preg_replace('~<[a-z]+(.*)></[a-z]+>~', '\1', $html);
498
- $html = preg_replace('~<[a-z]+(.*)/?>~', '\1', $html);
499
-
500
- $this->assertEquals($content, $html);
501
- }
502
-
503
- public function testAttrs()
504
- {
505
- $dom = $this->html5->loadHTML('<!doctype html>
506
- <html lang="en">
507
- <body>
508
- <div id="foo" class="bar baz">foo bar baz</div>
509
- </body>
510
- </html>');
511
-
512
- $stream = fopen('php://temp', 'w');
513
- $r = new OutputRules($stream, $this->html5->getOptions());
514
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
515
-
516
- $list = $dom->getElementsByTagName('div');
517
-
518
- $m = $this->getProtectedMethod('attrs');
519
- $m->invoke($r, $list->item(0));
520
-
521
- $content = stream_get_contents($stream, -1, 0);
522
- $this->assertEquals(' id="foo" class="bar baz"', $content);
523
- }
524
-
525
- public function testSvg()
526
- {
527
- $dom = $this->html5->loadHTML(
528
- '<!doctype html>
529
- <html lang="en">
530
- <body>
531
- <div id="foo" class="bar baz">foo bar baz</div>
532
- <svg width="150" height="100" viewBox="0 0 3 2">
533
- <rect width="1" height="2" x="0" fill="#008d46" />
534
- <rect width="1" height="2" x="1" fill="#ffffff" />
535
- <rect width="1" height="2" x="2" fill="#d2232c" />
536
- <rect id="Bar" x="300" y="100" width="300" height="100" fill="rgb(255,255,0)">
537
- <animate attributeName="x" attributeType="XML" begin="0s" dur="9s" fill="freeze" from="300" to="0" />
538
- </rect>
539
- </svg>
540
- </body>
541
- </html>');
542
-
543
- $stream = fopen('php://temp', 'w');
544
- $r = new OutputRules($stream, $this->html5->getOptions());
545
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
546
-
547
- $list = $dom->getElementsByTagName('svg');
548
- $r->element($list->item(0));
549
- $contents = stream_get_contents($stream, -1, 0);
550
- $this->assertRegExp('|<svg width="150" height="100" viewBox="0 0 3 2">|', $contents);
551
- $this->assertRegExp('|<rect width="1" height="2" x="0" fill="#008d46" />|', $contents);
552
- $this->assertRegExp('|<rect id="Bar" x="300" y="100" width="300" height="100" fill="rgb\(255,255,0\)">|', $contents);
553
- }
554
-
555
- public function testMath()
556
- {
557
- $dom = $this->html5->loadHTML(
558
- '<!doctype html>
559
- <html lang="en">
560
- <body>
561
- <div id="foo" class="bar baz">foo bar baz</div>
562
- <math>
563
- <mi>x</mi>
564
- <csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">
565
- <mo>&PlusMinus;</mo>
566
- </csymbol>
567
- <mi>y</mi>
568
- </math>
569
- </body>
570
- </html>');
571
-
572
- $stream = fopen('php://temp', 'w');
573
- $r = new OutputRules($stream, $this->html5->getOptions());
574
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
575
-
576
- $list = $dom->getElementsByTagName('math');
577
- $r->element($list->item(0));
578
- $content = stream_get_contents($stream, -1, 0);
579
- $this->assertRegExp('|<math>|', $content);
580
- $this->assertRegExp('|<csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">|', $content);
581
- }
582
-
583
- public function testProcessorInstruction()
584
- {
585
- $dom = $this->html5->loadHTMLFragment('<?foo bar ?>');
586
-
587
- $stream = fopen('php://temp', 'w');
588
- $r = new OutputRules($stream, $this->html5->getOptions());
589
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
590
-
591
- $r->processorInstruction($dom->firstChild);
592
- $content = stream_get_contents($stream, -1, 0);
593
- $this->assertRegExp('|<\?foo bar \?>|', $content);
594
- }
595
-
596
- public function testAddressTag()
597
- {
598
- $dom = $this->html5->loadHTML(
599
- '<!doctype html>
600
- <html lang="en">
601
- <body>
602
- <address>
603
- <a href="../People/Raggett/">Dave Raggett</a>,
604
- <a href="../People/Arnaud/">Arnaud Le Hors</a>,
605
- contact persons for the <a href="Activity">W3C HTML Activity</a>
606
- </address>
607
- </body>
608
- </html>');
609
-
610
- $stream = fopen('php://temp', 'w');
611
- $r = new OutputRules($stream, $this->html5->getOptions());
612
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
613
-
614
- $list = $dom->getElementsByTagName('address');
615
- $r->element($list->item(0));
616
- $contents = stream_get_contents($stream, -1, 0);
617
-
618
- $this->assertRegExp('|<address>|', $contents);
619
- $this->assertRegExp('|<a href="../People/Raggett/">Dave Raggett</a>,|', $contents);
620
- $this->assertRegExp('|<a href="../People/Arnaud/">Arnaud Le Hors</a>,|', $contents);
621
- $this->assertRegExp('|contact persons for the <a href="Activity">W3C HTML Activity</a>|', $contents);
622
- $this->assertRegExp('|</address>|', $contents);
623
- }
624
-
625
- /**
626
- * Ensure direct DOM manipulation doesn't break TEXT_RAW elements (iframe, script, etc...).
627
- */
628
- public function testHandlingInvalidRawContent()
629
- {
630
- $dom = $this->html5->loadHTML(
631
- '<!doctype html>
632
- <html lang="en" id="base">
633
- <body>
634
- <script id="template" type="x-tmpl-mustache">
635
- <h1>Hello!</h1>
636
- </script>
637
- </body>
638
- </html>');
639
-
640
- $badNode = $dom->createElement('p', 'Bar');
641
-
642
- // modify the content of the TEXT_RAW element: <script id="template"> appending dom nodes
643
- $styleElement = $dom->getElementById('template');
644
- $styleElement->appendChild($badNode);
645
-
646
- $contents = $this->html5->saveHTML($dom);
647
-
648
- $this->assertTrue(false !== strpos($contents, '<script id="template" type="x-tmpl-mustache">
649
- <h1>Hello!</h1>
650
- <p>Bar</p></script>'));
651
- }
652
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php DELETED
@@ -1,136 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests\Serializer;
4
-
5
- use Masterminds\HTML5\Serializer\OutputRules;
6
- use Masterminds\HTML5\Serializer\Traverser;
7
-
8
- class TraverserTest extends \Masterminds\HTML5\Tests\TestCase
9
- {
10
- protected $markup = '<!doctype html>
11
- <html lang="en">
12
- <head>
13
- <meta charset="utf-8">
14
- <title>Test</title>
15
- </head>
16
- <body>
17
- <p>This is a test.</p>
18
- </body>
19
- </html>';
20
-
21
- public function setUp()
22
- {
23
- $this->html5 = $this->getInstance();
24
- }
25
-
26
- /**
27
- * Using reflection we make a protected method accessible for testing.
28
- *
29
- * @param string $name
30
- * The name of the method on the Traverser class to test
31
- *
32
- * @return \ReflectionMethod \ReflectionMethod for the specified method
33
- */
34
- public function getProtectedMethod($name)
35
- {
36
- $class = new \ReflectionClass('\Masterminds\HTML5\Serializer\Traverser');
37
- $method = $class->getMethod($name);
38
- $method->setAccessible(true);
39
-
40
- return $method;
41
- }
42
-
43
- public function getTraverser()
44
- {
45
- $stream = fopen('php://temp', 'w');
46
-
47
- $dom = $this->html5->loadHTML($this->markup);
48
- $t = new Traverser($dom, $stream, $html5->getOptions());
49
-
50
- // We return both the traverser and stream so we can pull from it.
51
- return array(
52
- $t,
53
- $stream,
54
- );
55
- }
56
-
57
- public function testConstruct()
58
- {
59
- // The traverser needs a place to write the output to. In our case we
60
- // use a stream in temp space.
61
- $stream = fopen('php://temp', 'w');
62
-
63
- $html5 = $this->getInstance();
64
-
65
- $r = new OutputRules($stream, $this->html5->getOptions());
66
- $dom = $this->html5->loadHTML($this->markup);
67
-
68
- $t = new Traverser($dom, $stream, $r, $html5->getOptions());
69
-
70
- $this->assertInstanceOf('\Masterminds\HTML5\Serializer\Traverser', $t);
71
- }
72
-
73
- public function testFragmentDeprecated()
74
- {
75
- $html = '<span class="bar">foo</span><span></span><div>bar</div>';
76
- $input = new \Masterminds\HTML5\Parser\StringInputStream($html);
77
- $dom = $this->html5->parseFragment($input);
78
-
79
- $this->assertInstanceOf('\DOMDocumentFragment', $dom);
80
-
81
- $stream = fopen('php://temp', 'w');
82
- $r = new OutputRules($stream, $this->html5->getOptions());
83
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
84
- $t->walk();
85
-
86
- $this->assertEquals($html, stream_get_contents($stream, -1, 0));
87
- }
88
-
89
- public function testFragment()
90
- {
91
- $html = '<span class="bar">foo</span><span></span><div>bar</div>';
92
- $dom = $this->html5->parseFragment($html);
93
-
94
- $this->assertInstanceOf('\DOMDocumentFragment', $dom);
95
-
96
- $stream = fopen('php://temp', 'w');
97
- $r = new OutputRules($stream, $this->html5->getOptions());
98
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
99
- $t->walk();
100
-
101
- $this->assertEquals($html, stream_get_contents($stream, -1, 0));
102
- }
103
-
104
- public function testProcessorInstructionDeprecated()
105
- {
106
- $html = '<?foo bar ?>';
107
- $input = new \Masterminds\HTML5\Parser\StringInputStream($html);
108
- $dom = $this->html5->parseFragment($input);
109
-
110
- $this->assertInstanceOf('\DOMDocumentFragment', $dom);
111
-
112
- $stream = fopen('php://temp', 'w');
113
- $r = new OutputRules($stream, $this->html5->getOptions());
114
-
115
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
116
- $t->walk();
117
-
118
- $this->assertEquals($html, stream_get_contents($stream, -1, 0));
119
- }
120
-
121
- public function testProcessorInstruction()
122
- {
123
- $html = '<?foo bar ?>';
124
- $dom = $this->html5->parseFragment($html);
125
-
126
- $this->assertInstanceOf('\DOMDocumentFragment', $dom);
127
-
128
- $stream = fopen('php://temp', 'w');
129
- $r = new OutputRules($stream, $this->html5->getOptions());
130
-
131
- $t = new Traverser($dom, $stream, $r, $this->html5->getOptions());
132
- $t->walk();
133
-
134
- $this->assertEquals($html, stream_get_contents($stream, -1, 0));
135
- }
136
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/HTML5/TestCase.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- namespace Masterminds\HTML5\Tests;
4
-
5
- use Masterminds\HTML5;
6
- use PHPUnit\Framework\TestCase as BaseTestCase;
7
-
8
- class TestCase extends BaseTestCase
9
- {
10
- const DOC_OPEN = '<!DOCTYPE html><html><head><title>test</title></head><body>';
11
-
12
- const DOC_CLOSE = '</body></html>';
13
-
14
- public function testFoo()
15
- {
16
- // Placeholder. Why is PHPUnit emitting warnings about no tests?
17
- }
18
-
19
- public function getInstance(array $options = array())
20
- {
21
- return new HTML5($options);
22
- }
23
-
24
- protected function wrap($fragment)
25
- {
26
- return self::DOC_OPEN . $fragment . self::DOC_CLOSE;
27
- }
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/benchmark/example.html DELETED
@@ -1,6403 +0,0 @@
1
-
2
- <!DOCTYPE html>
3
- <!--[if (gt IE 9)|!(IE)]> <!--> <html lang="en" class="no-js edition-domestic app-homepage" itemscope xmlns:og="http://opengraphprotocol.org/schema/"> <!--<![endif]-->
4
- <!--[if IE 9]> <html lang="en" class="no-js ie9 lt-ie10 edition-domestic app-homepage" xmlns:og="http://opengraphprotocol.org/schema/"> <![endif]-->
5
- <!--[if IE 8]> <html lang="en" class="no-js ie8 lt-ie10 lt-ie9 edition-domestic app-homepage" xmlns:og="http://opengraphprotocol.org/schema/"> <![endif]-->
6
- <!--[if (lt IE 8)]> <html lang="en" class="no-js lt-ie10 lt-ie9 lt-ie8 edition-domestic app-homepage" xmlns:og="http://opengraphprotocol.org/schema/"> <![endif]-->
7
- <head>
8
- <title>The New York Times - Breaking News, World News & Multimedia</title>
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
10
- <link rel="shortcut icon" href="https://static01.nyt.com/favicon.ico" />
11
- <link rel="apple-touch-icon-precomposed" sizes="144×144" href="https://static01.nyt.com/images/icons/ios-ipad-144x144.png" />
12
- <link rel="apple-touch-icon-precomposed" sizes="114×114" href="https://static01.nyt.com/images/icons/ios-iphone-114x144.png" />
13
- <link rel="apple-touch-icon-precomposed" href="https://static01.nyt.com/images/icons/ios-default-homescreen-57x57.png" />
14
- <meta name="sourceApp" content="nyt-v5" />
15
- <meta id="applicationName" name="applicationName" content="homepage" />
16
- <meta id="foundation-build-id" name="foundation-build-id" content="" />
17
- <link rel="canonical" href="https://www.nytimes.com" />
18
- <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" />
19
- <link rel="alternate" media="only screen and (max-width: 640px)" href="http://mobile.nytimes.com" />
20
- <link rel="alternate" media="handheld" href="http://mobile.nytimes.com" />
21
- <meta name="robots" content="noarchive,noodp,noydir" />
22
- <meta name="description" content="The New York Times: Find breaking news, multimedia, reviews & opinion on Washington, business, sports, movies, travel, books, jobs, education, real estate, cars & more at nytimes.com." />
23
- <meta name="CG" content="Homepage" />
24
- <meta name="SCG" content="" />
25
- <meta name="PT" content="Homepage" />
26
- <meta name="PST" content="" />
27
- <meta name="application-name" content="The New York Times" />
28
- <meta name="msapplication-starturl" content="https://www.nytimes.com" />
29
- <meta name="msapplication-task" content="name=Search;action-uri=http://query.nytimes.com/search/sitesearch?src=iepin;icon-uri=https://static01.nyt.com/images/icons/search.ico" />
30
- <meta name="msapplication-task" content="name=Most Popular;action-uri=http://www.nytimes.com/gst/mostpopular.html?src=iepin;icon-uri=https://static01.nyt.com/images/icons/mostpopular.ico" />
31
- <meta name="msapplication-task" content="name=Video;action-uri=http://video.nytimes.com/?src=iepin;icon-uri=https://static01.nyt.com/images/icons/video.ico" />
32
- <meta name="msapplication-task" content="name=Homepage;action-uri=https://www.nytimes.com?src=iepin&amp;adxnnl=1;icon-uri=https://static01.nyt.com/images/icons/homepage.ico" />
33
- <meta property="og:url" content="https://www.nytimes.com" />
34
- <meta property="og:type" content="website" />
35
- <meta property="og:title" content="Breaking News, World News & Multimedia" />
36
- <meta property="og:description" content="The New York Times: Find breaking news, multimedia, reviews & opinion on Washington, business, sports, movies, travel, books, jobs, education, real estate, cars & more at nytimes.com." />
37
- <meta property="og:image" content="https://static01.nyt.com/images/icons/t_logo_291_black.png" />
38
- <meta property="fb:app_id" content="9869919170" />
39
- <meta name="apple-itunes-app" content="app-id=357066198, affiliate-data=at=10lIEQ&ct=Web%20iPad%20Smart%20App%20Banner&pt=13036" />
40
- <meta name="keywords" content="Hurricane Harvey (2017),Federal Emergency Management Agency,Beaumont (Tex),Houston (Tex),Hurricane Harvey (2017),Hurricanes and Tropical Storms,Weather,Houston (Tex),Beaumont (Tex),Harris County (Tex),Hurricane Harvey (2017),Texas,Floods,Hurricanes and Tropical Storms,Houston (Tex),Hurricane Harvey (2017),Floods,Deaths (Fatalities),Beaumont (Tex),Hurricane Harvey (2017),Deaths (Fatalities),Louisiana,Texas,Hurricane Harvey (2017),National Hurricane Center,Houston (Tex),Hurricane Harvey (2017),Area Planning and Renewal,Houston (Tex),Floods,New Orleans (La),Hurricane Harvey (2017),Corporate Taxes,Tax Credits, Deductions and Exemptions,Philanthropy,Houston (Tex),Hurricane Harvey (2017),Federal Aid (US),Federal Emergency Management Agency,Small Business Administration,Real Estate and Housing (Residential),Floods,Hurricane Harvey (2017),Humanitarian Aid,Frauds and Swindling,Hurricane Harvey (2017),Floods,Texas,Beaumont (Tex),port arthur texas,Floods,Hurricane Harvey (2017),Houston (Tex),Rain,Refineries,Hurricane Harvey (2017),Hurricanes and Tropical Storms,Evacuations and Evacuees,Texas,United States Politics and Government,Taxation,United States Economy,Springfield (Mo),Trump, Donald J,Tax Shelters,United States Economy,Corporate Taxes,Trump, Donald J,Republican Party,United States Politics and Government,Immigration Detention,Law and Legislation,Illegal Immigration,Trump, Donald J,Patient Protection and Affordable Care Act (2010),Health Insurance and Managed Care,State Children's Health Insurance Program (S-CHIP),United States International Relations,Extortion and Blackmail,Trump, Donald J,North Korea,Cohen, Michael D (1966- ),Russian Interference in 2016 US Elections and Ties to Trump Associates,House Committee on Intelligence,Trump, Donald J,Putin, Vladimir V,United States International Relations,Terrorism,United States Politics and Government,Afghanistan War (2001- ),United States Defense and Military Forces,Haqqani Network,Taliban,Trump, Donald J,Tillerson, Rex W,Pakistan,India,Leukemia,Immune System,Genetic Engineering,Cancer,Children's Hospital of Philadelphia,Food and Drug Administration,Novartis AG,University of Pennsylvania,June, Carl H,Whitehead, Emma,vis-multimedia,Accidents and Safety,Buildings (Structures),Mumbai (India),Tennis,United States Open (Tennis),Sharapova, Maria,Think Tanks,Google Inc,Alphabet Inc,New America Foundation,Schmidt, Eric E,Slaughter, Anne-Marie,Lynn, Barry,Open Markets,Computers and the Internet,Brazil,Amazon Jungle,Mines and Mining,Forests and Forestry,Indigenous People,Temer, Michel (1940- ),Zeid Ra'ad Zeid Al Hussein,Trump, Donald J,United Nations,News and News Media,Freedom of the Press,Newspapers,United States Politics and Government,Charlottesville, Va, Violence (August, 2017),United States Politics and Government,Afghanistan War (2001- ),United States Defense and Military Forces,Defense Department,Afghanistan,Exercise,Cooking and Cookbooks,Seasonal Affective Disorder (SAD),Sleep,Airlines and Airplanes,Comedy and Humor,Travel and Vacations,Monuments and Memorials (Structures),Politics and Government,de Blasio, Bill,Columbus, Christopher,New York City,David Tang,Deaths (Obituaries),Fashion and Apparel,Shanghai Tang,Entrepreneurship,London (England),Hong Kong,National Aeronautics and Space Administration,Space and Astronomy,Solar System,Exploration and Explorers,The Big Bang Theory (TV Program),Young Sheldon (TV Program),Television,Lorre, Chuck,Parsons, Jim,Social Media,Family Courts,Ethics and Official Misconduct,Administration for Children's Services (NYC),Legal Aid Society,Hansell, David,vis-multimedia,Australia,Same-Sex Marriage, Civil Unions and Domestic Partnerships,Political Advertising,Whales and Whaling,International Court of Justice (UN),Sea Shepherd Conservation Society,Antarctic Regions,Japan,Southern Ocean,Mathematics,Archaeology and Anthropology,Babylon (Iraq),Mansfield, Daniel F,Wildberger, Norman J,Historia Mathematica (Journal),Olympic Games,Olympic Games (1972),International Olympic Committee,Munich (Germany),Glasgow (Scotland),Great Britain,Travel and Vacations,Writing and Writers,Books and Literature,Ward, Jesmyn" />
41
- <meta name="video:playerId" content="2640832222001" />
42
- <meta name="video:publisherId" content="1749339200" />
43
- <meta name="video:publisherReadToken" content="cE97ArV7TzqBzkmeRVVhJ8O6GWME2iG_bRvjBTlNb4o." />
44
- <meta name="dfp-ad-unit-path" content="homepage/us" />
45
- <meta name="dfp-amazon-enabled" content="false" />
46
- <meta name="adxPage" content="homepage.nytimes.com/index.html" />
47
-
48
- <link id="legacy-zam5nzz" rel="stylesheet" type="text/css" href="https://typeface.nyt.com/css/zam5nzz.css" media="all" />
49
- <!--[if (gt IE 9)|!(IE)]> <!-->
50
- <link rel="stylesheet" type="text/css" media="screen" href="https://a1.nyt.com/assets/homepage/20170810-135137/css/homepage/styles.css" />
51
- <!--<![endif]-->
52
- <!--[if lte IE 9]>
53
- <link rel="stylesheet" type="text/css" media="screen" href="https://a1.nyt.com/assets/homepage/20170810-135137/css/homepage/styles-ie.css" />
54
- <![endif]-->
55
- <!-- begin abra -->
56
- <script>
57
- var NYTD=NYTD||{};NYTD.Abra=function(t){"use strict";function n(t){var n=i[t];return n&&n[1]||null}function e(t,n){if(t){var e,o,r=n[0],i=n[1],u=0,c=0;if(1!==i.length||4294967296!==i[0])for(e=a(t+" "+r)>>>0,u=0,c=0;o=i[u++];)if(e<(c+=o[0]))return o}}function o(n,e,o,a){s+="subject="+n+"&test="+encodeURIComponent(e)+"&variant="+encodeURIComponent(o||0)+"&url="+encodeURIComponent(t.location.href)+"&instant=1&skipAugment=true\n",a&&f.push(a),c||(c=t.setTimeout(r,0))}function r(){var n=new t.XMLHttpRequest,e=f;n.withCredentials=!0,n.open("POST",u),n.onreadystatechange=function(){var t,o;if(4==n.readyState)for(t=200==n.status?null:new Error(n.statusText);o=e.shift();)o(t)},n.send(s),s="",f=[],c=null}function a(t){for(var n,e,o,r,a,i,u,c=0,s=0,f=[],l=[n=1732584193,e=4023233417,~n,~e,3285377520],h=[],p=t.length;s<=p;)h[s>>2]|=(s<p?t.charCodeAt(s):128)<<8*(3-s++%4);for(h[u=p+8>>2|15]=p<<3;c<=u;c+=16){for(n=l,s=0;s<80;n=[0|[(i=((t=n[0])<<5|t>>>27)+n[4]+(f[s]=s<16?~~h[c+s]:i<<1|i>>>31)+1518500249)+((e=n[1])&(o=n[2])|~e&(r=n[3])),a=i+(e^o^r)+341275144,i+(e&o|e&r|o&r)+882459459,a+1535694389][0|s++/20],t,e<<30|e>>>2,o,r])i=f[s-3]^f[s-8]^f[s-14]^f[s-16];for(s=5;s;)l[--s]=l[s]+n[s]|0}return l[0]}var i,u,c,s="",f=[];return n.init=function(n,r){var a,c,s,f,l,h=[],p=(t.document.cookie.match(/(^|;) *nyt-a=([^;]*)/)||[])[2],d=(t.document.cookie.match(/(^|;) *ab7=([^;]*)/)||[])[2],m=new RegExp("[?&]abra(=([^&#]*))"),g=m.exec(t.location.search);if(g&&g[2]&&(d=d?g[2]+"&"+d:g[2]),i)throw new Error("can't init twice");if(u=r,i={},d)for(d=decodeURIComponent(d).split("&"),a=0;a<d.length;a++)l=d[a].split("="),l[0]in i||(i[l[0]]=[,l[1],1],o("ab-alloc",l[0],l[1]),l[1]&&h.push(l[0]+"="+l[1]));for(a=0;a<n.length;a++)s=n[a],(c=s[0])in i||(f=e(p,s)||[],i[c]=f,f[1]&&h.push(c.replace(/[^\w-]/g)+"="+(""+f[1]).replace(/[^\w-]/g)),f[2]&&o("ab-alloc",c,f[1]));h.length&&t.document.documentElement.setAttribute("data-nyt-ab",h.join(" "))},n.reportExposure=function(n,e){var r=i[n];r&&r[2]?o("ab-expose",n,r[1],e):e&&t.setTimeout(function(){e(null)},0)},n}(this);
58
- </script>
59
- <script>NYTD.Abra.init([["HOME_ComingUp",[[2147483648,"control",1],[2147483648,"comingup",1]]],["HOME_NewsEvent2",[[3865470567,"full",1],[429496729,"control",1]]],["HOME_ElectionPrediction",[[3865470567,"on",1],[429496729,"control",1]]],["HOME_geoTrending",[[1460288881,"Control",1],[1417339208,"Header",1],[1417339207,"NoHeader",1]]],["www-ad-diagnostic",[[21474837,"1",0],[4273492459,null,0]]],["www-signup-favor-test",[[773094114,"0",1],[773094113,"1",1],[773094113,"2",1],[773094114,"3",1],[773094113,"4",1],[429496729,"5",1],[0,null,0]]],["www-readlater-test-1",[[1073741824,"control",1],[360777253,"controlHoldout",1],[1073741824,"variant1",1],[356482286,"variant1Holdout",1],[1073741824,"variant2",1],[356482285,"variant2Holdout",1]]],["www-signup-favor-test-v3",[[1288490189,"1",1],[1288490189,"2",1],[429496730,"4",1],[1288490188,"5",1]]],["www-signup-favor-test-v4",[[214748365,"control",1],[858993459,"1",1],[858993460,"2",1],[644245094,"4",1],[858993459,"5",1],[858993459,"6",1]]],["www-fabrik-off",[[4294967296,"1",1]]],["Liftoff",[[19520627,"0",1],[19520626,"1",1],[19520627,"2",1],[19520626,"3",1],[19520626,"4",1],[19520627,"5",1],[14839112,"0",1],[14839112,"1",1],[14839112,"2",1],[14839112,"3",1],[14839112,"4",1],[14839112,"5",1],[34359738,"8",1],[34359738,"9",1],[34359739,"12",1],[34359738,"13",1],[34359739,"16",1],[34359738,"17",1],[3882650435,null,0]]],["HP_AATest",[[2147483648,"0",1],[2147483648,"1",1]]],["EC_SampleTest",[[2147483648,"variantA",0],[2147483648,"variantB",0]]],["EC_DigiAbandonmentTest",[[4294967296,"sendAbandonmentEmail",1]]],["EC_HdAbandonmentTest",[[4294967296,"sendAbandonmentEmail",1]]],["EC_CrosswordsUpsellTest",[[2147483648,"control",1],[2147483648,"upsell",1]]],["EC_NewSubOnboardingTest",[[2147483648,"control",1],[2147483648,"sov1",1]]],["PaywallAU",[[429496730,"0",1],[3865470566,"1",1]]]], '//et.nytimes.com/')</script>
60
- <!-- end abra -->
61
-
62
- <script>
63
- (function () {
64
- var e;
65
- if (/^mobile\./.test(window.location.hostname)) {
66
- var vi2 = (document.cookie.match(/(?:^|;) *vi=([^;]*)/) || [])[1] || '',
67
- vi1 = (document.cookie.match(/(?:^|;) *nyt\.np\.vi=([^;]*)/) || [])[1] || '';
68
- e = /^b1/.test(vi2) ? 'WP_ProjectVi&variant=vi'
69
- : /^z1/.test(vi2) ? 'WP_ProjectVi&variant=0'
70
- : /^a2/.test(vi2) ? 'WP_ProjectVi2&variant=hp-st'
71
- : /^b2/.test(vi2) ? 'WP_ProjectVi2&variant=hp'
72
- : /^c2/.test(vi2) ? 'WP_ProjectVi2&variant=st'
73
- : /^z2/.test(vi2) ? 'WP_ProjectVi2&variant=0'
74
- : /^1\|/.test(vi1) ? 'WP_ProjectVi&variant=vi'
75
- : /^2\|/.test(vi1) ? 'WP_ProjectVi&variant=0'
76
- : '';
77
- } else if (/^www\./.test(window.location.hostname)) {
78
- var vi = (document.cookie.match(/(?:^|;) *vi_www_hp=([^;]*)/) || [])[1] || '';
79
- e = /^a2/.test(vi) ? 'WP_ProjectVi_www_hp&variant=hp-st'
80
- : /^b2/.test(vi) ? 'WP_ProjectVi_www_hp&variant=hp'
81
- : /^c2/.test(vi) ? 'WP_ProjectVi_www_hp&variant=st'
82
- : /^z2/.test(vi) ? 'WP_ProjectVi_www_hp&variant=0'
83
- : '';
84
- }
85
- if (e) {
86
- var x = new XMLHttpRequest();
87
- x.withCredentials = true;
88
- x.open('POST','//et.nytimes.com/');
89
- x.send('subject=ab-alloc&test=' + e + '&url=' + encodeURIComponent(window.location.href) + '&instant=1&skipAugment=true\n');
90
- }
91
- })();
92
- </script>
93
- <script type="text/javascript">
94
- document.addEventListener('DOMContentLoaded', function () {
95
- if (!window.NYTD) {
96
- window.NYTD = {};
97
- }
98
- window.NYTD.Global = {
99
- displayBriefings: function (time) {
100
- var timedBriefings = document.getElementsByClassName('timedBriefing');
101
- if (!timedBriefings.length) {
102
- return;
103
- }
104
- var attrClass, attrStart, attrEnd, startTime, endTime;
105
- var reFormat = /^\d{2}:\d{2}$/;
106
- var reHide = / timedBriefingHide/i;
107
-
108
- for (var i = 0; i < timedBriefings.length; i++) {
109
- attrClass = timedBriefings[i].getAttribute('class');
110
- attrStart = timedBriefings[i].getAttribute('data-start-time');
111
- attrEnd = timedBriefings[i].getAttribute('data-end-time');
112
- if (attrStart && attrEnd && reFormat.test(attrStart) && reFormat.test(attrEnd)) {
113
- startTime = Number.parseInt(attrStart.replace(':', ''), 10);
114
- endTime = Number.parseInt(attrEnd.replace(':', ''), 10);
115
-
116
- // need to account for when the time span is across midnight
117
- if (startTime > endTime) {
118
- if (((time >= startTime) || (time < endTime)) && reHide.test(attrClass)) {
119
- timedBriefings[i].setAttribute('class', attrClass.replace(reHide, ''));
120
- }
121
- if (((time < startTime) && (time >= endTime)) && !reHide.test(attrClass)) {
122
- timedBriefings[i].setAttribute('class', (attrClass + ' timedBriefingHide'));
123
- }
124
- } else {
125
- if ((time >= startTime) && (time < endTime) && reHide.test(attrClass)) {
126
- timedBriefings[i].setAttribute('class', attrClass.replace(reHide, ''));
127
- }
128
- if (((time < startTime) || (time >= endTime)) && !reHide.test(attrClass)) {
129
- timedBriefings[i].setAttribute('class', (attrClass + ' timedBriefingHide'));
130
- }
131
- }
132
- }
133
- }
134
- },
135
- testTZ: function (offset) {
136
- var testTime = new Date(new Date().getTime() + (offset * 3600 * 1000));
137
- window.NYTD.Global.displayBriefings((testTime.getUTCHours() * 100) + testTime.getUTCMinutes());
138
- return testTime.toUTCString().replace(' GMT', '');
139
- }
140
- };
141
- var now = new Date();
142
- var previewTime = (now.getHours() * 100) + now.getMinutes();
143
- var rePreviewTime = /previewTime=(\d*)/;
144
- var matches = window.location.search.match(rePreviewTime);
145
- if (matches) {
146
- previewTime = Number.parseInt(matches[1]);
147
- }
148
- window.NYTD.Global.displayBriefings(previewTime);
149
- });
150
- </script>
151
- <script type="text/javascript">var googletag=googletag||{};googletag.cmd=googletag.cmd||[],function(){var t=document.createElement("script");t.async=!0,t.type="text/javascript";var e="https:"==document.location.protocol;t.src=(e?"https:":"http:")+"//www.googletagservices.com/tag/js/gpt.js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(t,o)}();</script>
152
- <script src="https://cdn.optimizely.com/public/3013110282/s/home_prod.js"></script>
153
-
154
- <!--esi
155
- <script id="user-info-data" type="application/json">
156
- <esi:include src="/svc/web-products/userinfo-v3.json" />
157
- </script>
158
- -->
159
- <script id="magnum-feature-flags" type="application/json">["limitFabrikSave","moreFollowSuggestions","unfollowComments","allTheEmphases","videoVHSCover","videoVHSHomepageCover","videoVHSHomepageNewControls","videoVHSNewControls","videoVHSEmbeddedOnly","additionalOpinionRegions","hpViewability","freeTrial","hpPrototype","useCollectionApiForWell","enableFlexFrameAds","weatherLocation","fabrikWebsocketsOnly","NYTExperiment","hpRealEstateAd","jitterbug","updatedVideoPromoSmall","videoEmbed360","PersonalizationApiUpdate","globalBriefings","removeInternationalEdition","clientSideABRA","abraOverrideVersion","signupFavor","mapleFreeTrial","piiBlockDFP","anchorsHttps","smarterLivingRec","viDesktopTest","caslOpt"]</script>
160
- <script id="mpulse">
161
- (function(){
162
- if (window.BOOMR && window.BOOMR.version) { return; }
163
- var dom,doc,where,iframe = document.createElement("iframe"),win = window;
164
-
165
- function boomerangSaveLoadTime(e) {
166
- win.BOOMR_onload=(e && e.timeStamp) || new Date().getTime();
167
- }
168
- if (win.addEventListener) {
169
- win.addEventListener("load", boomerangSaveLoadTime, false);
170
- } else if (win.attachEvent) {
171
- win.attachEvent("onload", boomerangSaveLoadTime);
172
- }
173
-
174
- iframe.src = "javascript:void(0)";
175
- iframe.title = ""; iframe.role = "presentation";
176
- (iframe.frameElement || iframe).style.cssText = "width:0;height:0;border:0;display:none;";
177
- where = document.getElementsByTagName("script")[0];
178
- where.parentNode.insertBefore(iframe, where);
179
-
180
- try {
181
- doc = iframe.contentWindow.document;
182
- } catch(e) {
183
- dom = document.domain;
184
- iframe.src="javascript:var d=document.open();d.domain='"+dom+"';void(0);";
185
- doc = iframe.contentWindow.document;
186
- }
187
- doc.open()._l = function() {
188
- var js = this.createElement("script");
189
- if (dom) { this.domain = dom; }
190
- js.id = "boomr-if-as";
191
- js.src = "//c.go-mpulse.net/boomerang/" +
192
- "ATH8A-MAMN8-XPXCH-N5KAX-8D239";
193
- BOOMR_lstart=new Date().getTime();
194
- this.body.appendChild(js);
195
- };
196
- doc.write('<body onload="document._l();">');
197
- doc.close();
198
- })();
199
- </script>
200
- <script>
201
- var require = {
202
- baseUrl: 'https://a1.nyt.com/assets/',
203
- waitSeconds: 20,
204
- paths: {
205
- 'foundation': 'homepage/20170810-135137/js/foundation',
206
- 'shared': 'homepage/20170810-135137/js/shared',
207
- 'homepage': 'homepage/20170810-135137/js/homepage',
208
- 'application': 'homepage/20170810-135137/js/homepage/',
209
- 'videoFactory': 'https://static01.nyt.com/js2/build/video/2.0/videofactoryrequire',
210
- 'videoPlaylist': 'https://static01.nyt.com/js2/build/video/players/extended/2.0/appRequire',
211
- 'auth/mtr': 'https://static01.nyt.com/js/mtr',
212
- 'auth/growl': 'https://static01.nyt.com/js/auth/growl/default',
213
- 'vhs': 'https://static01.nyt.com/video/vhs/build/vhs-2.x.min',
214
- 'vhs3': 'https://static01.nyt.com/video-static/vhs3/vhs.min'
215
- }
216
- };
217
- </script>
218
- <!--[if (gte IE 9)|!(IE)]> <!-->
219
- <script data-main="foundation/main" src="https://a1.nyt.com/assets/homepage/20170810-135137/js/foundation/lib/framework.js"></script>
220
- <!--<![endif]-->
221
- <!--[if lt IE 9]>
222
- <script>
223
- require.map = { '*': { 'foundation/main': 'foundation/legacy_main' } };
224
- </script>
225
- <script data-main="foundation/legacy_main" src="https://a1.nyt.com/assets/homepage/20170810-135137/js/foundation/lib/framework.js"></script>
226
- <![endif]-->
227
- </head>
228
- <body>
229
-
230
- <style>
231
- .lt-ie10 .messenger.suggestions {
232
- display: block !important;
233
- height: 50px;
234
- }
235
-
236
- .lt-ie10 .messenger.suggestions .message-bed {
237
- background-color: #f8e9d2;
238
- border-bottom: 1px solid #ccc;
239
- }
240
-
241
- .lt-ie10 .messenger.suggestions .message-container {
242
- padding: 11px 18px 11px 30px;
243
- }
244
-
245
- .lt-ie10 .messenger.suggestions .action-link {
246
- font-family: "nyt-franklin", arial, helvetica, sans-serif;
247
- font-size: 10px;
248
- font-weight: bold;
249
- color: #a81817;
250
- text-transform: uppercase;
251
- }
252
-
253
- .lt-ie10 .messenger.suggestions .alert-icon {
254
- background: url('https://static01.nyt.com/images/icons/icon-alert-12x12-a81817.png') no-repeat;
255
- width: 12px;
256
- height: 12px;
257
- display: inline-block;
258
- margin-top: -2px;
259
- float: none;
260
- }
261
-
262
- .lt-ie10 .masthead,
263
- .lt-ie10 .navigation,
264
- .lt-ie10 .comments-panel {
265
- margin-top: 50px !important;
266
- }
267
-
268
- .lt-ie10 .ribbon {
269
- margin-top: 97px !important;
270
- }
271
- </style>
272
- <div id="suggestions" class="suggestions messenger nocontent robots-nocontent" style="display:none;">
273
- <div class="message-bed">
274
- <div class="message-container last-message-container">
275
- <div class="message">
276
- <span class="message-content">
277
- <i class="icon alert-icon"></i><span class="message-title">NYTimes.com no longer supports Internet Explorer 9 or earlier. Please upgrade your browser.</span>
278
- <a href="http://www.nytimes.com/content/help/site/ie9-support.html" class="action-link">LEARN MORE »</a>
279
- </span>
280
- </div>
281
- </div>
282
- </div>
283
- </div>
284
-
285
- <div id="shell" class="shell">
286
- <header id="masthead" class="masthead theme-pinned-masthead" role="banner">
287
-
288
- <div id="announcements-container" class="announcements-container"></div>
289
-
290
- <div id="Header1" class="ad header1-ad"></div>
291
-
292
- <div class="masthead-cap-container">
293
-
294
- <div id="masthead-cap" class="masthead-cap">
295
-
296
- <div class="quick-navigation button-group">
297
-
298
- <button class="button sections-button enable-a11y">
299
- <i class="icon sprite-icon"></i><span class="button-text">Sections</span>
300
- </button>
301
- <button class="button search-button">
302
- <i class="icon sprite-icon"></i><span class="button-text">Search</span>
303
- </button>
304
- <a class="button skip-button skip-to-content visually-hidden focusable" href="#top-news">Skip to content</a>
305
- <a class="button skip-button skip-to-navigation visually-hidden focusable" href="#site-index-navigation">Skip to navigation</a>
306
- </div><!-- close quick-navigation -->
307
-
308
- <div class="user-tools">
309
-
310
- <div id="Bar1" class="ad bar1-ad"></div>
311
-
312
- <div class="user-tools-button-group button-group">
313
- <button class="button subscribe-button hidden" data-href="https://www.nytimes.com/subscriptions/Multiproduct/lp3004.html?campaignId=4XUYF">Subscribe Now</button>
314
- <button class="button login-button hidden">Log In</button>
315
- <button class="button notifications-button hidden"><i class="icon sprite-icon"></i><span class="button-text">0</span></button>
316
- <button class="button user-settings-button">
317
- <i class="icon sprite-icon"></i><span class="button-text">Settings</span>
318
- </button>
319
- </div>
320
-
321
- </div><!-- close user-tools -->
322
-
323
- </div><!-- close masthead-cap -->
324
-
325
- </div><!-- close masthead-cap-container -->
326
-
327
- <div class="masthead-meta">
328
- <div class="editions tab">
329
-
330
- <ul class="editions-menu">
331
- <li class="edition-domestic-toggle active">English</li>
332
- <li class="edition-chinese-toggle"><a href="http://cn.nytimes.com" target="_blank" data-edition="chinese">中文 (Chinese)</a></li>
333
- <li class="edition-spanish-toggle"><a href="https://www.nytimes.com/es/" data-edition="spanish">Español</a></li>
334
- </ul>
335
-
336
- </div><!-- close editions -->
337
-
338
- <div id="TopLeft" class="ad top-left-ad"></div>
339
- <div id="TopRight" class="ad top-right-ad"></div>
340
-
341
- <h2 class="branding"><a href="https://www.nytimes.com/">
342
- <svg class="nyt-logo" width="379" height="64" role="img" aria-label="The New York Times">
343
- <image width="379" height="64" xlink:href="https://a1.nyt.com/assets/homepage/20170810-135137/images/foundation/logos/nyt-logo-379x64.svg" src="https://a1.nyt.com/assets/homepage/20170810-135137/images/foundation/logos/nyt-logo-379x64.png" alt="The New York Times" border="0"/>
344
- </svg>
345
-
346
- </a></h2>
347
- <ul class="masthead-menu">
348
- <li class="date">Thursday, August 31, 2017</li><li class="todays-paper"><a href="http://www.nytimes.com/pages/todayspaper/index.html" data-collection="todays-paper"><i class="icon sprite-icon"></i>Today’s Paper</a></li><li class="video"><a href="https://www.nytimes.com/video" data-collection="video"><i class="icon sprite-icon"></i>Video</a></li><li id="weather" class="weather hidden" data-collection="weather"><button class="button weather-button"></button></li><li id="markets" class="markets hidden" data-collection="markets"></li>
349
- </ul>
350
-
351
- </div><!-- close masthead-meta -->
352
-
353
- <nav id="mini-navigation" class="mini-navigation">
354
- <h2 class="visually-hidden">Quick Site Sections Navigation</h2>
355
- <ul class="mini-navigation-menu">
356
- <li>
357
- <button class="button sections-button">
358
- <i class="icon sprite-icon"></i>
359
- <span class="button-text">Sections</span>
360
- </button>
361
- </li><li>
362
- <button class="button search-button">
363
- <i class="icon sprite-icon"></i>
364
- <span class="button-text">Search</span>
365
- </button>
366
- </li>
367
-
368
- <li class="shortcuts-9A43D8FC-F4CF-44D9-9B34-138D30468F8F ">
369
- <a href="https://www.nytimes.com/pages/world/index.html">World</a>
370
- </li>
371
-
372
-
373
- <li class="shortcuts-23FD6C8B-62D5-4CEA-A331-6C2A9A1223BE ">
374
- <a href="https://www.nytimes.com/pages/national/index.html">U.S.</a>
375
- </li>
376
-
377
-
378
- <li class="shortcuts-80E6DEE6-87E4-4AD0-9152-14FA6B07E5AB ">
379
- <a href="https://www.nytimes.com/pages/politics/index.html">Politics</a>
380
- </li>
381
-
382
-
383
- <li class="shortcuts-C4DC8C0C-E148-4201-BF10-82F1C903DBFB ">
384
- <a href="https://www.nytimes.com/pages/nyregion/index.html">N.Y.</a>
385
- </li>
386
-
387
-
388
- <li class="shortcuts-104D1E63-9701-497B-8CF4-A4D120C9014E domestic">
389
- <a href="https://www.nytimes.com/pages/business/index.html">Business</a>
390
- </li>
391
-
392
-
393
- <li class="shortcuts-A257D89A-0D3C-40AF-9C34-1A25A7947D94 international">
394
- <a href="https://www.nytimes.com/pages/business/international/index.html">Business</a>
395
- </li>
396
-
397
-
398
- <li class="shortcuts-AD8090D7-4137-4D71-84C8-70DA3BD89778 domestic">
399
- <a href="https://www.nytimes.com/pages/opinion/index.html">Opinion</a>
400
- </li>
401
-
402
-
403
- <li class="shortcuts-09736473-CB3F-4B2F-9772-3AF128ABE12D international">
404
- <a href="https://www.nytimes.com/pages/opinion/international/index.html">Opinion</a>
405
- </li>
406
-
407
-
408
- <li class="shortcuts-78FBAD45-31A9-4EC7-B172-7D62A2B9955E ">
409
- <a href="https://www.nytimes.com/pages/technology/index.html">Tech</a>
410
- </li>
411
-
412
-
413
- <li class="shortcuts-A4B35924-DB6C-4EA3-997D-450810F4FEE6 ">
414
- <a href="https://www.nytimes.com/section/science">Science</a>
415
- </li>
416
-
417
-
418
- <li class="shortcuts-7D6BE1AF-8CD8-430B-8B2A-17CD0EAA99AC ">
419
- <a href="https://www.nytimes.com/pages/health/index.html">Health</a>
420
- </li>
421
-
422
-
423
- <li class="shortcuts-DE2B278B-2783-4506-AAD5-C15A5BB6DA1A domestic">
424
- <a href="https://www.nytimes.com/pages/sports/index.html">Sports</a>
425
- </li>
426
-
427
-
428
- <li class="shortcuts-BE66F420-C51B-461D-B487-CACF62E94AAE international">
429
- <a href="https://www.nytimes.com/pages/sports/international/index.html">Sports</a>
430
- </li>
431
-
432
-
433
- <li class="shortcuts-C5BFA7D5-359C-427B-90E6-6B7245A6CDD8 domestic">
434
- <a href="https://www.nytimes.com/pages/arts/index.html">Arts</a>
435
- </li>
436
-
437
-
438
- <li class="shortcuts-0202D0E4-C59B-479A-BD42-6F1766459781 international">
439
- <a href="https://www.nytimes.com/pages/arts/international/index.html">Arts</a>
440
- </li>
441
-
442
-
443
- <li class="shortcuts-B3DFBD82-F298-43B3-9458-219B4F6AA2A5 domestic">
444
- <a href="https://www.nytimes.com/pages/fashion/index.html">Style</a>
445
- </li>
446
-
447
-
448
- <li class="shortcuts-CC9E2674-F6C4-4A39-813B-F5AB0C515CEA international">
449
- <a href="https://www.nytimes.com/pages/style/international/index.html">Style</a>
450
- </li>
451
-
452
-
453
- <li class="shortcuts-D9C94A2B-0364-4D25-8383-592CC66F82D4 domestic">
454
- <a href="https://www.nytimes.com/pages/dining/index.html">Food</a>
455
- </li>
456
-
457
-
458
- <li class="shortcuts-FDEFB811-B483-4C3D-A25A-FD07BE5EAD96 international">
459
- <a href="https://www.nytimes.com/pages/dining/international/index.html">Food</a>
460
- </li>
461
-
462
-
463
- <li class="shortcuts-FDA10AC4-4738-4099-91E8-15584765C8D7 ">
464
- <a href="https://www.nytimes.com/section/travel">Travel</a>
465
- </li>
466
-
467
-
468
- <li class="shortcuts-E57A148E-0CB9-4C02-966D-28B119710151 ">
469
- <a href="https://www.nytimes.com/pages/magazine/index.html">Magazine</a>
470
- </li>
471
-
472
-
473
- <li class="shortcuts-052C33AD-1404-4DB6-AA70-0901DB1AD95B ">
474
- <a href="https://www.nytimes.com/section/t-magazine">T Magazine</a>
475
- </li>
476
-
477
-
478
- <li class="shortcuts-92720057-BCB6-4BDB-9351-12F29393259F ">
479
- <a href="https://www.nytimes.com/section/realestate">Real Estate</a>
480
- </li>
481
-
482
- <li><button class="button all-sections-button">all</button></li>
483
- </ul>
484
- </nav>
485
- <div class="search-flyout-panel flyout-panel">
486
- <button class="button close-button" type="button"><i class="icon"></i><span class="visually-hidden">Close search</span></button>
487
- <nav class="search-form-control form-control layout-horizontal">
488
- <h2 class="visually-hidden">Site Search Navigation</h2>
489
- <form class="search-form" role="search">
490
- <div class="control">
491
- <div class="label-container visually-hidden">
492
- <label for="search-input">Search NYTimes.com</label>
493
- </div>
494
- <div class="field-container">
495
- <input id="search-input" name="search-input" type="text" class="search-input text" autocomplete="off" placeholder="Search NYTimes.com" />
496
-
497
- <button type="button" class="button clear-button" tabindex="-1" aria-describedby="clear-search-input"><i class="icon"></i><span id="clear-search-input" class="visually-hidden">Clear this text input</span></button>
498
- <div class="auto-suggest" style="display: none;">
499
- <ol></ol>
500
- </div>
501
- <button class="button submit-button" type="submit">Go</button>
502
- </div>
503
- </div><!-- close control -->
504
- </form>
505
- </nav>
506
-
507
-
508
- </div><!-- close flyout-panel -->
509
- <div id="notification-modals" class="notification-modals"></div>
510
-
511
- </header><!-- close masthead -->
512
- <div id="masthead-placeholder" class="masthead-placeholder"></div>
513
- <nav id="navigation" class="navigation">
514
- <h2 class="visually-hidden">Site Navigation</h2>
515
- </nav><!-- close navigation -->
516
-
517
- <nav id="mobile-navigation" class="mobile-navigation hidden">
518
- <h2 class="visually-hidden">Site Mobile Navigation</h2>
519
- </nav><!-- close mobile-navigation -->
520
-
521
- <div id="navigation-edge" class="navigation-edge"></div>
522
- <div id="page" class="page">
523
- <main id="main" class="main" role="main">
524
- <div id="Top" class="ad hp-top-ad nocontent nojitter robots-nocontent"></div>
525
- <div id="Top_Close" class="ad hp-top-ad-close hidden nocontent robots-nocontent"></div>
526
- <div id="Top5" class="ad top5-ad hidden nocontent robots-nocontent"></div>
527
-
528
- <div class="span-abc-region region">
529
- <div class="collection">
530
- <script type="text/javascript">
531
- /*! geoip_resolver 2016-06-30 */
532
- +function(a){"function"==typeof define&&define.amd?define("nytint-geoip",[],a):window.nytint_geoip=a()}(function(){"use strict";var a="nyt-geoip",b=document.getElementsByTagName("html"),c=!1,d=["continent_code","country_code","region","dma_code","postal_code","time_zone","zone_abbr"],e=function(b){var c=new XMLHttpRequest,d=null,e=null;try{if(d=JSON.parse(sessionStorage.getItem(a)),d&&void 0!==d.country_code)return g(d,b),d}catch(h){}c.onload=function(a){return a.target?(e=f(a.target),"undefined"==typeof e?!1:(g(e,b),e)):!1},c.onreadystatechange=function(){4===c.readyState&&200!==c.status&&console.error(c.status)},c.open("GET","https://geoip.newsdev.nytimes.com/",!0);try{c.responseType="json"}catch(h){}c.send()},f=function(a){var b=null;switch(!0){case"json"===a.responseType:b=a.response.data;break;case null!==a.response:b=JSON.parse(a.response).data;break;case null!==a.responseText:b=JSON.parse(a.responseText).message}return void 0!==b?b:null},g=function(e,f){if(!b)return!1;try{sessionStorage.setItem(a,JSON.stringify(e))}catch(g){}if(void 0!==e&&!c){for(var i,j=0;i=d[j];j++)if(void 0!==e[i]){var k=["geo",h(i),e[i]].join("-");b[0].classList.add(k)}c=!0}return"function"==typeof f&&f(e),e},h=function(a){var b=a;switch(!0){case a.indexOf("zone_abbr")>=0:b=a.replace("zone_abbr","us-timezone");break;case a.indexOf("_zone")>=0:b=a.replace("_zone","zone");break;case a.indexOf("_code")>=0:b=a.replace("_code","")}return b};return window.NYTINT_TESTING||e(),e});
533
- (function() { require(['nytint-geoip']); })();
534
- </script><!-- HP CSS Fixes -->
535
- <style>
536
-
537
- /* Fix for Small Video Promo Heds */
538
- .story.theme-feature.video-promo-small.updated-video-promo-small .video-promo-small-container .story-heading{ padding: 0!important; }
539
-
540
-
541
- /* Fix MM icons in kickers */
542
- .kicker .icon:before { top: 0px; }
543
- .kicker .media.slideshow { margin-bottom: 0px; }
544
-
545
- /* Hiding Hacks */
546
-
547
- .nythpHideKickers .kicker, .nythpHideBylines .byline, .nythpHideTimestamps .timestamp {
548
- display: none;
549
- }
550
-
551
- /* banner hed modifications */
552
- .span-ab-top-region .story.theme-summary .story-heading {
553
- line-height: 2.1rem;
554
- }
555
-
556
- /* spacing fixes */
557
- .collection.headlines {
558
- margin-bottom: 12px;
559
- }
560
-
561
-
562
- /* Alterations to the Centered Feature Photo Spot Treatment */
563
-
564
- .b-column .photo-spot-region .story.theme-feature .story-heading {
565
- font-size: 1.35rem;
566
- line-height: 1.65rem;
567
- }
568
-
569
- .b-column .photo-spot-region .story.theme-feature .story-heading {
570
- padding: 0 22px; /* for headline wrapping */
571
- }
572
- .b-column .photo-spot-region .story.theme-feature .summary {
573
- line-height: 18px;
574
- }
575
-
576
- .story.theme-feature .summary {
577
- line-height: 1.125rem;
578
- color: #333;
579
- margin: 0 10px 3px;
580
- }
581
-
582
-
583
-
584
-
585
- /* Bullet Treatments */
586
-
587
- .ab-column .collection article ul, .span-abc-region .collection article ul {
588
- margin-top: 8px;
589
- margin-bottom: -3px;
590
- }
591
-
592
- .ab-column .collection article ul.refer, .span-abc-region .collection article ul.refer {
593
- margin-top: 2px;
594
- margin-bottom: 0px;
595
- }
596
-
597
- .ab-column .collection article ul li, .span-abc-region .collection article ul li {
598
- position: relative;
599
- margin-bottom: 8px;
600
- padding-left: 9px;
601
- font-size: 13px;
602
- font-size: 0.8125rem;
603
- line-height: 18px;
604
- line-height: 1.125rem;
605
- font-weight: 400;
606
- }
607
- .ab-column .collection article ul li:before, .span-abc-region .collection article ul li:before {
608
- border-radius: 1px;
609
- background-color: #000;
610
- width: 3px;
611
- height: 3px;
612
- content: '';
613
- position: absolute;
614
- display: block;
615
- top: 7px;
616
- left: 2px;
617
- }
618
-
619
- .ab-column .collection article ul li:last-child, .span-abc-region .collection article ul li:last-child {
620
- margin-bottom: 0=;
621
- }
622
-
623
- .ab-column .collection article[data-collection-renderstyle="HpSumMediumMedia"] ul {
624
- margin-bottom: 0px;
625
- }
626
-
627
- .theme-news-headlines li {
628
- position: relative!important;
629
- margin-bottom: 4px!important;
630
- padding-left: 8px!important;
631
- }
632
- .theme-news-headlines {
633
- margin-top: 2px!important;
634
- }
635
-
636
- .a-column .story.theme-summary.headline-medium-summary .medium-thumb {
637
- float: none;
638
- clear: none;
639
- margin-left: 0px;
640
- }
641
-
642
- .first-column-region .story.theme-summary.headline-medium-summary .story-heading, .a-lede-package-region .story.theme-summary.headline-medium-summary .story-heading {
643
- font-style: italic;
644
- }
645
-
646
- .first-column-region .collection:first-child .story.theme-summary.headline-medium-summary .story-heading, .a-lede-package-region .collection:first-child .story.theme-summary.headline-medium-summary .story-heading {
647
- font-size: 26px;
648
- font-size: 1.625rem;
649
- line-height: 28px;
650
- line-height: 1.75rem;
651
- font-weight: 700;
652
- }
653
-
654
-
655
- /* Breaking News/Developing Headers */
656
- .nythpBreaking {
657
- color: #A81817;
658
- border-top: 3px solid #A81817;
659
- padding-top: 2px;
660
- padding-bottom: 3px;
661
- margin-top: 12px;
662
- }
663
-
664
- .nythpBreaking h6 {
665
- text-transform: uppercase;
666
- font-family: "nyt-franklin",arial,helvetica,sans-serif;
667
- font-weight: 700;
668
- }
669
-
670
- .nythpDeveloping {
671
- color: #FD8249;
672
- border-top-color: #FD8249;
673
- }
674
-
675
- .nythpBreaking.nythpNoRule {
676
- border: none;
677
- margin-top: 0px;
678
- }
679
-
680
- .above-banner-region .nythpBreaking {
681
- margin-bottom: 10px;
682
- }
683
-
684
-
685
- /* BEGIN .HPHEADER STYLING */
686
-
687
- .hpHeader, .span-abc-region h3.collection-kicker {
688
- margin-bottom: 10px;
689
- }
690
-
691
- .hpHeader h6, .span-abc-region h3.collection-kicker {
692
- color: #000;
693
- font-family: "nyt-franklin",helvetica,arial,sans-serif;
694
- text-transform: uppercase;
695
- font-size: 12px;
696
- font-weight: 700;
697
- letter-spacing: .5px;
698
- border-bottom: 2px solid #ccc;
699
- display: inline-block;
700
- line-height: 15px;
701
- }
702
-
703
- .span-abc-region h6, .span-abc-region h3.collection-kicker {
704
- font-size: 13px;
705
- line-height: 16px;
706
-
707
- }
708
-
709
- .hpHeader h6 a, .span-abc-region h3.collection-kicker a,
710
- .hpHeader h6 a:visited, .span-abc-region h3.collection-kicker a:visited {
711
- text-decoration: none;
712
- color: #000;
713
- }
714
-
715
- .hpHeader h6:hover,
716
- .hpHeader h6:active {
717
- border-color: #222222;
718
- }
719
-
720
- .above-banner-region .hpHeader, .span-ab-top-region .hpHeader, .span-ab-lede-package-region .hpHeader, .b-column .hpHeader, .c-column .hpHeader {
721
- text-align: center;
722
- }
723
-
724
- .above-banner-region .hpHeader h6, .span-ab-top-region .hpHeader h6, .span-ab-lede-package-region .hpHeader h6, .b-column .hpHeader h6, .c-column .hpHeader h6 {
725
- margin: 0 auto;
726
- padding: 0 2px;
727
- }
728
-
729
- .span-ab-top-region .a-column .hpHeader, .span-ab-lede-package-region .a-column .hpHeader, .b-column .split-layout .hpHeader, .b-column .nythpSplitCode .hpHeader {
730
- text-align: left;
731
- }
732
-
733
- .b-column .split-layout .hpHeader h6, .b-column .nythpSplitCode .hpHeader h6 {
734
- margin: 0;
735
- padding: 0;
736
- }
737
-
738
- .hpLive h6, .hpLive h6:hover, .hpLive h6:active {
739
- color: #a81817;
740
- border-color: #a81817;
741
- }
742
-
743
- .hpDeveloping h6, .hpDeveloping h6:hover, .hpDeveloping h6:active {
744
- color: #fd8249;
745
- border-color: #fd8249;
746
- }
747
-
748
- .hpSingleRule {
749
- border-top: 1px solid #e2e2e2;
750
- padding-top: 12px;
751
- }
752
-
753
-
754
-
755
- /* added by matte to fix slideshow bug */
756
-
757
- .loader-container {
758
- display: none;
759
- }
760
-
761
- /* Newsletter Sign-Up Modules (updated 6/28/2017) */
762
-
763
- div.notification-widget {
764
- min-height:38px;
765
- }
766
- .notification-signup .notifications-title {
767
- color: black;
768
- font-family: "nyt-cheltenham-sh",georgia,"times new roman",times,serif;
769
- font-size: 15px;
770
- line-height: 18px;
771
- font-weight: 200;
772
- }
773
- .notification-signup .notification-text {
774
- margin-top: 3px;
775
- margin-bottom: 5px;
776
- color: #999;
777
- font-size: 13px;
778
- line-height: 18px;
779
- }
780
-
781
- .notification-widget input,
782
- .notification-widget button {
783
- outline: none;
784
- }
785
-
786
- .notification-widget .notify-email {
787
- height: 30px;
788
- width: 312px;
789
- margin-top: 0px;
790
- padding: 14px;
791
- color: #a6a6a6;
792
- border: 1px solid rgba(97,136,166,.5);
793
- border-top-left-radius: 2px;
794
- border-bottom-left-radius: 2px;
795
- border-top-right-radius: 0px;
796
- border-bottom-right-radius: 0px;
797
- box-shadow: none;
798
- font-family: 'nyt-franklin', Helvetica, sans-serif;
799
- font-size: 14px;
800
- line-height: 1;
801
- }
802
- .notification-widget .notify-email:hover{
803
- border-color:rgba(97,136,166,1);
804
- border-width:2px;
805
- padding:13px;
806
- }
807
- .notification-widget .notify-email.error {
808
- border-color: #FF9859;
809
- }
810
- .notification-widget .button {
811
- margin-top: 0px;
812
- padding: 8px;
813
- border: none;
814
- border-top-left-radius: 0px;
815
- border-bottom-left-radius: 0px;
816
- border-top-right-radius: 2px;
817
- border-bottom-right-radius: 2px;
818
- background: #6288a5;
819
- color: white;
820
- font-family: 'nyt-franklin', Helvetica, sans-serif;
821
- font-size: 14px;
822
- font-weight: 500;
823
- line-height: 1;
824
- text-transform: capitalize;
825
- }
826
-
827
- .notification-widget .dirtyform .button:hover,
828
- .notification-widget .signedin .button:hover {
829
- background-color: #326891;
830
- }
831
-
832
- .notification-widget .signedin .button {
833
- border-top-left-radius: 2px;
834
- border-bottom-left-radius: 2px;
835
- }
836
-
837
- .notification-widget div.error {
838
- font-family: 'nyt-franklin', Helvetica, sans-serif;
839
- color: #FF9859;
840
- font-size: 12px;
841
- margin-top: 5px;
842
- }
843
-
844
- /* post subscribe notification */
845
- .notification-signup span {
846
- font-size: 14px;
847
- color: ##ffffff;
848
- font-family: 'nyt-franklin', Helvetica, sans-serif;
849
- font-weight: 600;
850
- }
851
- .notification-widget div[data-status="initial"]{
852
- display:inline-block;
853
- float:right;
854
- }
855
-
856
- .notification-widget div[data-status="working"]{
857
- opacity:0;
858
- }
859
-
860
- /* already subscribed notification */
861
- .notification-widget div[data-status="initial"] div,
862
- .notification-widget div[data-status="subscribed"] div,
863
- .notification-widget div[data-status="working"] div {
864
- font-family: 'nyt-franklin', Helvetica, sans-serif;
865
- font-size: 14px;
866
- color: #666 !important;
867
- }
868
- .notification-widget div[data-status="initial"] div{
869
- line-height: 31px;
870
- }
871
- .notification-widget div[data-status="initial"] div div{
872
- margin-right:8px;
873
- display:inline-block;
874
- }
875
-
876
- .notification-widget div[data-status="initial"] div .account-name,
877
- .notification-widget div[data-status="subscribed"] div .account-name{
878
- font-weight: 700;
879
- }
880
- .notification-signup a {
881
- font-size: 14px;
882
- font-family: 'nyt-franklin', Helvetica, sans-serif;
883
- font-weight: 400;
884
- margin-top: 10px;
885
- display: block;
886
- color: #6187a6!important;
887
- }
888
- .notification-widget .email-address a{
889
- margin-top: 5px;
890
- display: block;
891
- color: #6187a6!important;
892
- }
893
- .viewport-medium-10 .interactive-leadin, .viewport-medium-10 .notification-signup .notification-text{
894
- max-width: 375px;
895
- }
896
- .notification-signup{
897
- padding-top:11px;
898
- }
899
-
900
- a[data-reactid=".0.0.2"] {
901
- font-size: 11px; }
902
-
903
- .notification-widget div[data-status="initial"][data-show-disclaimer="true"] div.disclaimer {
904
- display: none;
905
- color: #CCC !important;
906
- font-size: 14px;
907
- }
908
-
909
- .notification-widget div.signedin[data-status="initial"][data-show-disclaimer="true"] div.disclaimer {
910
- top: -20px;
911
- right: 14px;
912
- position: relative;
913
- height: 8px;
914
- display: block;
915
- }
916
-
917
- .notification-widget div.not-signedin[data-status="initial"][data-show-disclaimer="true"] div.disclaimer {
918
- display: block;
919
- text-align: right;
920
- }
921
-
922
-
923
- .notification-widget div[data-status="initial"][data-show-disclaimer="true"] div.disclaimer a {
924
- color: #CCC !important;
925
- text-decoration: underline;
926
- }
927
-
928
- .notification-widget div[data-status="initial"][data-show-disclaimer="true"] div.welcome {
929
- position: relative;
930
- top: -5px;
931
- color: #999 !important;
932
- }
933
-
934
-
935
- /* Show All hack */
936
- html.showAllGeoAb .timedBriefingHide, html.showAllGeoAb .nythpElectionPredictionCCol, html.showAllGeoAb .nythpNYRegionPromo, html.showAllGeoAb .nythpGeoCanada, html.showAllGeoAb .nythpCAToday { display: block !important }
937
-
938
-
939
- </style>
940
-
941
-
942
-
943
-
944
- <!-- Begin Smarter Living Styles and Scripts -->
945
-
946
- <script type="text/javascript">
947
- require(['foundation/main'], function () {
948
- require([
949
- 'jquery/nyt',
950
- 'foundation/helpers/utils',
951
- 'foundation/views/page-manager'
952
- ], function ($, utils, pageManager) {
953
- $(document).ready(function () {
954
- var param = {
955
- 'contentCollection': 'smarter-living'
956
- };
957
- $('.nythpSmarterLiving a').each(function () {
958
- var href = $(this).attr('href');
959
- href = utils.appendQueryParams(href, param);
960
- $(this).attr('href', href);
961
- });
962
- });
963
- });
964
- });
965
- </script>
966
- <style>
967
-
968
- .nythpSmarterLiving {
969
- zoom:1;
970
- border-bottom: 0px solid #e2e2e2;
971
- margin-bottom: 12px;
972
- }
973
-
974
- .nythpSmarterLiving:after,
975
- .nythpSmarterLiving:before {
976
- content: "";
977
- display: table;
978
- }
979
- .nythpSmarterLiving:after{
980
- clear: both;
981
- }
982
- .nythpSmarterLiving article {
983
- float:left;
984
- width: 177px;
985
- }
986
- .nythpSmarterLiving article.story.theme-summary {
987
- margin-bottom: 0px;
988
- }
989
-
990
- .nythpSmarterLiving article:last-child,
991
- .nythpSmarterLiving article:nth-of-type(2) {
992
- margin-left: 21px;
993
- }
994
-
995
- .nythpSmarterLiving .byline, .nythpSmarterLiving .summary, .nythpSmarterLiving article .kicker, .nythpSmarterLiving .theme-comments, .nythpSmarterLiving .refer {
996
- display: none;
997
- }
998
-
999
- .nythpSmarterLiving .story.theme-summary .story-heading {
1000
- width: 96px;
1001
- float: right;
1002
- }
1003
-
1004
- .nythpSmarterLiving .story.theme-summary .thumb {
1005
- margin: 3px 6px 6px 0px;
1006
- float: left;
1007
- clear: none;
1008
- }
1009
-
1010
-
1011
- </style></div>
1012
- <div class="collection">
1013
- <style type="text/css">
1014
- .span-abc-region .story.theme-summary h1.story-heading {
1015
- font-size: 38px;
1016
- font-style: italic;
1017
- line-height: 44px;
1018
- margin-bottom: 10px;
1019
- margin-top:-8px;
1020
- font-family: "nyt-cheltenham",georgia,"times new roman",times,serif;
1021
- }
1022
-
1023
- .span-abc-region .nythpParisMega1stCol article[data-collection-renderstyle="LedeSum"].story.theme-summary h2.story-heading {
1024
- font-size: 1.625rem;
1025
- line-height: 1.75rem;
1026
- font-weight: 700;
1027
- font-style: italic;
1028
- font-family: "nyt-cheltenham",georgia,"times new roman",times,serif;
1029
- letter-spacing: 0.01em;
1030
- word-spacing: -0.1em;
1031
- }
1032
-
1033
- .span-abc-region .nythpParisMega1stCol .story.theme-summary h2.story-heading {
1034
- font-size: 20px;
1035
- font-size: 1.25rem;
1036
- line-height: 22px;
1037
- line-height: 1.375rem;
1038
- font-weight: 700;
1039
- font-style: normal;
1040
- font-family: "nyt-cheltenham",georgia,"times new roman",times,serif;
1041
- letter-spacing: 0.01em;
1042
- word-spacing: -0.1em;
1043
- }
1044
-
1045
- .span-abc-region .nythpSpanABCMiddleColumn .nytHPSplit-AB-Half .story.theme-summary h2.story-heading {
1046
- font-size: 16px;
1047
- font-size: 1rem;
1048
- line-height: 22px;
1049
- line-height: 1.375rem;
1050
- font-weight: 700;
1051
- font-style: normal;
1052
- font-family: "nyt-cheltenham",georgia,"times new roman",times,serif;
1053
- letter-spacing: 0.01em;
1054
- word-spacing: -0.1em;
1055
- }
1056
-
1057
-
1058
- .span-abc-region .nythpSpanABCMiddleColumn .nytHPSplit-AB-Half .story.theme-summary .thumb {
1059
- margin-top:-20px;
1060
- }
1061
-
1062
-
1063
-
1064
-
1065
- </style><!--FOR ALL CAPS-->
1066
- <style>
1067
- .span-ab-top-region .story.theme-summary h1.story-heading{
1068
- line-height:45px;
1069
- margin-top:2px;
1070
- }
1071
- </style>
1072
-
1073
- <div class="span-ab-top-region"><article class="story theme-summary banner" data-collection-renderstyle="Banner"><h1 class="story-heading">
1074
-
1075
- <!-- Link and Hed Go Here -->
1076
- <a href="https://www.nytimes.com/2017/08/30/us/small-towns-harvey.html">The Storm Marches On as Houston Surveys Wreckage
1077
- </a>
1078
-
1079
-
1080
-
1081
-
1082
- <span class="product-label theme-nyt-now" style="display:none;"><span class="visually-hidden">NYT Now</span><i class="icon dot-logo-icon"></i></span></h1></article></div></div>
1083
- <div class="collection">
1084
- <style>
1085
- .nythpSplitCode .column { margin-left: 21px; }
1086
- .nythpSplitCode .column:first-child { margin-left: 0px; }
1087
- .nythpSplitCode.layout { background: none; }
1088
- .nythpSplitCode .media.photo.medium-thumb { float: none; margin-left: 0; }
1089
- .nythpSpanABCMiddleColumn {width: 573px; float: right;}
1090
- .nythpSplitCode .nythpSpanABC_ABCol {width: 771px; float: left;}
1091
- .nythpSplitCode .nythpSpanABC_SpanABBottom {clear: both;}
1092
- <!--.nythpParisMegaBanner {} -->
1093
- </style>
1094
-
1095
- <div class="layout nythpSplitCode nythpParisMega">
1096
- <div class="nythpSpanABC_ABCol">
1097
- <div class="column nythpParisMega1stCol"><div>
1098
-
1099
- </div>
1100
- <div class="collection">
1101
- <article class="story theme-summary" id="topnews-100000005401006" data-story-id="100000005401006" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
1102
-
1103
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/small-towns-harvey.html">Hundreds of Towns in Harvey’s Path Hit by Devastating Rain</a></h2>
1104
-
1105
- <p class="byline">By CAMPBELL ROBERTSON, RICK ROJAS and SHAILA DEWAN </p>
1106
-
1107
- <p class="summary"><ul> <li>Harvey, downgraded to a tropical depression, moved to the east and punished a region of roughly 11 million people.
1108
- </li>
1109
- <li>In Houston, after the first night of a citywide curfew, many residents went outside for the first time in days to survey the wreckage. Officials have reported at least 38 deaths.
1110
- </li>
1111
- </ul></p>
1112
-
1113
-
1114
- </article>
1115
- </div>
1116
- <div class="collection">
1117
- <article class="story theme-summary" id="topnews-100000005399284" data-story-id="100000005399284" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
1118
-
1119
- <h3 class="kicker"><span class="timestamp"><strong>Live</strong></span> </h3>
1120
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/hurricane-harvey-flooding-houston.html">Explosions Reported at Chemical Plant</a></h2>
1121
-
1122
- <p class="byline">By THE NEW YORK TIMES <time class="timestamp" datetime="2017-08-31" data-eastern-timestamp="6:47 AM" data-utc-timestamp="1504176457">6:47 AM ET</time></p>
1123
-
1124
- <p class="summary">Two explosions were reported at a chemical plant about 30 miles from Houston that was damaged by Hurricane Harvey.</p>
1125
-
1126
- <p class="theme-comments">
1127
- <a href="https://www.nytimes.com/2017/08/30/us/hurricane-harvey-flooding-houston.html?hp&amp;target=comments#commentsContainer" class="comments-link"><i class="icon sprite-icon comments-icon"></i><span class="comment-count">&nbsp;Comments</span></a>
1128
- </p>
1129
-
1130
- </article>
1131
- </div>
1132
- <div class="collection">
1133
- <style>
1134
- .first-column-region .nythpMakeAColHedLikeB .story.theme-summary .story-heading,
1135
- .a-lede-package-region .nythpMakeAColHedLikeB .story.theme-summary .story-heading,
1136
- .span-abc-region .nythpParisMega1stCol .nythpMakeAColHedLikeB .story.theme-summary h2.story-heading {
1137
- font-size: 14px;
1138
- font-size: 0.875rem;
1139
- line-height: 16px;
1140
- line-height: 1rem;
1141
- font-weight: 700;
1142
- font-style: normal;
1143
- font-family: "nyt-cheltenham-sh",georgia,"times new roman",times,serif;
1144
- margin-bottom: 2px;
1145
- }
1146
- </style>
1147
-
1148
- <div class="nythpMakeAColHedLikeB"><article class="story theme-summary" id="topnews-100000005395157" data-story-id="100000005395157" data-rank="1" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
1149
-
1150
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/28/us/hurricane-harvey-texas.html">A Guide to the Storm</a></h2>
1151
-
1152
-
1153
- <p class="summary">Here’s an overview of coverage by The New York Times.</p>
1154
-
1155
-
1156
- </article>
1157
- </div></div>
1158
- <div class="collection">
1159
- </div></div>
1160
- <div class="column nythpSpanABCMiddleColumn"><div></div>
1161
- <div class="collection">
1162
- <!--
1163
-
1164
- ======================================================
1165
-
1166
- THIS IS A GENERATED TEMPLATE FILE. DO NOT EDIT.
1167
-
1168
- ======================================================
1169
-
1170
- -->
1171
- <!-- hp promo -->
1172
-
1173
- <!-- this file is generated from src/style.less -->
1174
- <style>/*
1175
- SHOW LIBRARY
1176
- ===================== */
1177
- .g-show-xsmall,
1178
- .g-show-small,
1179
- .g-show-smallplus,
1180
- .g-show-submedium,
1181
- .g-show-sub-medium,
1182
- .g-show-medium,
1183
- .g-show-large,
1184
- .g-show-xlarge {
1185
- display: none;
1186
- }
1187
- .g-show {
1188
- display: block;
1189
- }
1190
- .lt-ie10 .g-aiImg {
1191
- width: 100%;
1192
- }
1193
- /* story top */
1194
- .story.theme-main .story-header .story-meta .story-heading {
1195
- max-width: 720px;
1196
- margin: 0 auto 10px;
1197
- text-align: center;
1198
- line-height: 2.844rem;
1199
- font-size: 2.4rem;
1200
- }
1201
- @media only screen and (max-width: 1244px) {
1202
- .story.theme-main .story-header .story-meta .story-heading {
1203
- line-height: 2.5596rem;
1204
- font-size: 2.16rem;
1205
- }
1206
- }
1207
- @media only screen and (max-width: 719px) {
1208
- .story.theme-main .story-header .story-meta .story-heading {
1209
- line-height: 2.2752rem;
1210
- font-size: 1.92rem;
1211
- }
1212
- }
1213
- .story.theme-main .story-header .story-meta .interactive-leadin.summary {
1214
- max-width: 460px;
1215
- margin: 0 auto 20px auto;
1216
- text-align: center;
1217
- font-size: 17px;
1218
- line-height: 1.6;
1219
- }
1220
- .story.theme-main .story-header .story-meta .byline-dateline {
1221
- text-align: center;
1222
- }
1223
- /* top asset */
1224
- .g-top-asset {
1225
- margin-left: auto;
1226
- margin-right: auto;
1227
- margin-bottom: 20px;
1228
- }
1229
- .g-top-asset img {
1230
- width: 100%;
1231
- }
1232
- /* body text */
1233
- .g-body {
1234
- max-width: 460px;
1235
- margin-left: auto;
1236
- margin-right: auto;
1237
- }
1238
- .viewport-medium .g-body {
1239
- font-size: 17px;
1240
- line-height: 1.6;
1241
- }
1242
- .g-body a {
1243
- text-decoration: underline;
1244
- }
1245
- /* subhed */
1246
- .g-subhed h2 {
1247
- max-width: 460px;
1248
- margin: 2em auto 1em auto;
1249
- font: 700 1.2em/1.3em 'nyt-franklin', arial, sans-serif;
1250
- text-align: center;
1251
- }
1252
- .viewport-small-10 .g-subhed h2 {
1253
- font-size: 1.5em;
1254
- }
1255
- /* refer text box */
1256
- .g-refer {
1257
- max-width: 460px;
1258
- margin: 0 auto 25px;
1259
- padding: 12px 15px;
1260
- box-sizing: border-box;
1261
- background: #fffcd9;
1262
- }
1263
- .g-refer .g-body {
1264
- font-family: 'nyt-franklin', arial, sans-serif;
1265
- font-size: 16px;
1266
- line-height: 1.3;
1267
- margin-bottom: 0;
1268
- }
1269
- .g-refer a {
1270
- text-decoration: underline;
1271
- }
1272
- /* images */
1273
- .g-item-image {
1274
- margin: 25px auto;
1275
- }
1276
- .g-item-image img {
1277
- width: 100%;
1278
- }
1279
- /* video */
1280
- .g-item-video {
1281
- margin: 25px auto;
1282
- }
1283
- /* sources and credits */
1284
- .g-asset-source {
1285
- padding-top: 3px;
1286
- }
1287
- .g-asset-source .g-source {
1288
- font: 400 12px/15px 'nyt-franklin', arial, sans-serif;
1289
- color: #999;
1290
- }
1291
- .g-asset-source .g-pipe {
1292
- margin: 0 6px 0 3px;
1293
- font: 400 12px/12px 'nyt-franklin', arial, sans-serif;
1294
- color: #999;
1295
- }
1296
- .g-asset-source .g-caption {
1297
- font: 300 14px/17px georgia, 'times new roman', times, serif;
1298
- }
1299
- .g-asset-source .g-credit {
1300
- font: 400 12px/17px 'nyt-franklin', arial, sans-serif;
1301
- display: inline-block;
1302
- color: #999;
1303
- }
1304
- /* graphics */
1305
- .g-item-ai2html {
1306
- margin: 25px auto;
1307
- }
1308
- p.g-asset-hed {
1309
- font: 700 16px/18px 'nyt-franklin', arial, sans-serif;
1310
- margin-bottom: 0;
1311
- }
1312
- .g-map-key {
1313
- float: none;
1314
- clear: both;
1315
- overflow: hidden;
1316
- margin: 10px auto 4px auto;
1317
- }
1318
- .g-map-key .g-key-row {
1319
- margin-bottom: 5px;
1320
- margin-right: 15px;
1321
- float: left;
1322
- }
1323
- .viewport-small .g-map-key .g-key-row {
1324
- width: auto;
1325
- margin-bottom: 0;
1326
- }
1327
- .viewport-small-20 .g-map-key .g-key-row {
1328
- width: auto;
1329
- }
1330
- .g-map-key .g-key-row .g-key-rect,
1331
- .g-map-key .g-key-row .g-key-circle {
1332
- vertical-align: middle;
1333
- margin-right: 8px;
1334
- display: inline-block;
1335
- }
1336
- .g-map-key .g-key-row p {
1337
- font: 500 0.9em/1.6 'nyt-franklin', arial, sans-serif;
1338
- display: inline-block;
1339
- vertical-align: middle;
1340
- margin: -2px 0 0 0;
1341
- }
1342
- .viewport-small .g-map-key .g-key-row p {
1343
- max-width: 92%;
1344
- }
1345
- .viewport-small-20 .g-map-key .g-key-row p {
1346
- width: auto;
1347
- max-width: none;
1348
- }
1349
- .g-map-key .g-key-row .g-key-rect {
1350
- width: 22px;
1351
- height: 10px;
1352
- }
1353
- .g-map-key .g-key-row .g-key-circle {
1354
- width: 9px;
1355
- height: 9px;
1356
- border-radius: 50%;
1357
- }
1358
- .g-map-key .g-key-row .g-key-custom {
1359
- width: 20px;
1360
- height: 20px;
1361
- background-size: 100%;
1362
- display: block;
1363
- display: inline-block;
1364
- width: 24px;
1365
- height: 24px;
1366
- margin: -4px 2px 0 0;
1367
- }
1368
- .viewport-small .g-map-key .g-key-row-title p {
1369
- width: 100%;
1370
- max-width: none;
1371
- }
1372
- .g-red-dot,
1373
- .g-black-dot {
1374
- display: inline-block;
1375
- background: #d00;
1376
- color: white;
1377
- font-weight: bold;
1378
- width: 20px;
1379
- height: 20px;
1380
- font: 700 14px/1.4 'nyt-franklin', arial, sans-serif;
1381
- text-align: center;
1382
- border-radius: 10px;
1383
- line-height: 20px;
1384
- }
1385
- .g-black-dot {
1386
- background: #222;
1387
- }
1388
- /* column text */
1389
- .g-column-container {
1390
- max-width: 460px;
1391
- margin: 20px auto 0 auto;
1392
- }
1393
- .viewport-medium .g-column-container {
1394
- max-width: 1050px;
1395
- }
1396
- .viewport-large .g-column-container {
1397
- margin-bottom: 30px;
1398
- }
1399
- .g-column-container .g-column-hed {
1400
- font-family: 'nyt-franklin', arial, sans-serif;
1401
- font-weight: 700;
1402
- margin-bottom: 2px;
1403
- }
1404
- .g-column-container .g-column-col {
1405
- vertical-align: top;
1406
- }
1407
- .viewport-small .g-column-container .g-column-col {
1408
- display: block;
1409
- min-width: 100%;
1410
- }
1411
- .viewport-medium .g-column-container .g-column-col {
1412
- min-width: 0;
1413
- display: inline-block;
1414
- margin-right: 15px;
1415
- }
1416
- .viewport-medium .g-column-container .g-column-col:last-child {
1417
- margin-right: 0;
1418
- }
1419
- .g-column-container .g-column-asset,
1420
- .g-column-container .g-column-image {
1421
- margin-bottom: 8px;
1422
- }
1423
- .g-column-container .g-column-image img {
1424
- width: 100%;
1425
- }
1426
- /* tables */
1427
- .g-table {
1428
- margin: 0 auto;
1429
- margin-bottom: 25px;
1430
- }
1431
- .g-table tr {
1432
- border-bottom: 1px solid #ececec;
1433
- }
1434
- .g-table p {
1435
- font: 500 14px/1.4 'nyt-franklin', arial, sans-serif;
1436
- text-align: left;
1437
- margin: 6px 0;
1438
- }
1439
- /* charts */
1440
- .g-chart {
1441
- margin: 0 auto;
1442
- margin-bottom: 25px;
1443
- font: 500 14px/1.4 'nyt-franklin', arial, sans-serif;
1444
- }
1445
- .g-chart .g-chart-header {
1446
- font-weight: bold;
1447
- }
1448
- .g-chart .g-chart-row,
1449
- .g-chart .g-chart-header {
1450
- clear: both;
1451
- height: 22px;
1452
- margin-bottom: 9px;
1453
- }
1454
- .g-chart .g-chart-bar-container,
1455
- .g-chart .g-chart-label {
1456
- float: left;
1457
- height: 100%;
1458
- }
1459
- .g-chart .g-chart-bar-container {
1460
- margin-left: 20px;
1461
- }
1462
- .g-chart .g-chart-bar-pos,
1463
- .g-chart .g-chart-bar-neg {
1464
- height: 100%;
1465
- float: left;
1466
- }
1467
- .g-chart .g-chart-label,
1468
- .g-chart .g-chart-bar {
1469
- padding-top: 3px;
1470
- }
1471
- .g-chart .g-chart-label.not-first {
1472
- margin-left: 20px;
1473
- }
1474
- .g-chart .g-chart-bar {
1475
- height: 100%;
1476
- background: lightsteelblue;
1477
- position: relative;
1478
- }
1479
- .g-chart .g-chart-bar-label {
1480
- padding-left: 6px;
1481
- }
1482
- .g-chart .g-chart-bar-neg .g-chart-bar {
1483
- float: right;
1484
- }
1485
- .g-chart .g-chart-bar-neg .g-chart-bar-label {
1486
- text-align: right;
1487
- padding-right: 6px;
1488
- padding-left: 0px;
1489
- }
1490
- .g-chart .out-label {
1491
- padding-top: 3px;
1492
- display: none;
1493
- }
1494
- .g-chart .outside .out-label {
1495
- display: block;
1496
- }
1497
- .g-chart .outside .in-label {
1498
- display: none;
1499
- }
1500
- .g-chart .g-bold {
1501
- font-weight: bold;
1502
- }
1503
- /* grid */
1504
- .g-grid {
1505
- margin-bottom: 15px;
1506
- }
1507
- .g-grid .g-grid-item {
1508
- position: relative;
1509
- display: inline-block;
1510
- min-width: calc(50% - 5px);
1511
- }
1512
- .viewport-small-20 .g-grid .g-grid-item {
1513
- min-width: calc(33% - 5px);
1514
- }
1515
- .viewport-medium .g-grid .g-grid-item {
1516
- min-width: 0;
1517
- }
1518
- .g-grid .g-grid-item p {
1519
- font: 500 15px/1.4 'nyt-franklin', arial, sans-serif;
1520
- position: absolute;
1521
- bottom: 10px;
1522
- left: 10px;
1523
- color: #fff;
1524
- margin-bottom: 0;
1525
- }
1526
- /* lazy images */
1527
- .g-freebird-lazy {
1528
- display: block;
1529
- width: 100%;
1530
- height: auto;
1531
- }
1532
- .g-freebird-lazy.ll-init {
1533
- transition: opacity 0.3s ease-out;
1534
- opacity: 0;
1535
- }
1536
- .g-freebird-lazy.ll-loaded {
1537
- opacity: 1;
1538
- }
1539
- /* Mobile issues */
1540
- /* Get rid of border under intro and share tools on mobile */
1541
- .story-header.interactive-header {
1542
- border-bottom: none !important;
1543
- }
1544
- /* Share tools issues */
1545
- /* Pad out the kicker/sharetool space */
1546
- .story.theme-main .story-header .story-meta .kicker-container {
1547
- margin-bottom: 12px;
1548
- }
1549
- /* Override the moving sharetools on mobile */
1550
- .story.theme-main .story-header .story-meta .kicker-container .sharetools {
1551
- position: relative;
1552
- float: right;
1553
- /*right: 0px;*/
1554
- bottom: auto;
1555
- left: auto;
1556
- width: auto;
1557
- margin-top: -6px;
1558
- clear: none;
1559
- }
1560
- /* Maintain the proper space with the section name and kicker next to share tools */
1561
- .story.theme-main .story-header .story-meta .interactive-kicker {
1562
- float: left;
1563
- width: 70%;
1564
- display: inline-block;
1565
- }
1566
- .g-graphic.g-graphic-freebird .g-ad-wrapper {
1567
- margin: 30px auto;
1568
- max-width: 1050px;
1569
- }
1570
- .viewport-medium .g-graphic.g-graphic-freebird .g-ad-wrapper {
1571
- margin: 50px auto;
1572
- }
1573
- .g-graphic.g-graphic-freebird .g-ad-wrapper .ad {
1574
- border-top: 1px solid #e2e2e2 !important;
1575
- border-bottom: 1px solid #e2e2e2 !important;
1576
- margin: 0 auto;
1577
- padding: 10px 0;
1578
- overflow: hidden;
1579
- max-width: 100%;
1580
- }
1581
- .g-graphic.g-graphic-freebird .g-ad-wrapper .ad div {
1582
- margin: 0 auto;
1583
- display: block !important;
1584
- }
1585
- .g-graphic.g-graphic-freebird .g-ad-wrapper iframe {
1586
- margin: 0 auto;
1587
- display: block;
1588
- }
1589
- .g-graphic.g-graphic-freebird .g-ad-wrapper .g-ad-text {
1590
- text-align: center;
1591
- font: 500 12px/1.2 "nyt-franklin", arial, sans-serif;
1592
- color: #bfbfbf;
1593
- text-transform: uppercase;
1594
- margin-bottom: 7px;
1595
- }
1596
- .ad.top-ad {
1597
- border: none;
1598
- margin-left: auto;
1599
- margin-right: auto;
1600
- }
1601
- /* Center headlines for standalone and embedded interactives */
1602
- /* @import (inline) "nyt5/centered-headline.css"; */
1603
- /* Fullbleed interactive-graphic container */
1604
- /* remove left offset */
1605
- .viewport-medium-50 .masthead.masthead-theme-standard,
1606
- .viewport-large-20 .masthead.masthead-theme-standard {
1607
- margin-left: 0;
1608
- }
1609
-
1610
- .viewport-large-70 .masthead.masthead-theme-standard {
1611
- margin-left: auto;
1612
- }
1613
-
1614
- .viewport-medium-50 .masthead.masthead-theme-standard .quick-navigation,
1615
- .viewport-large-20 .masthead.masthead-theme-standard .quick-navigation {
1616
- left: 15px;
1617
- }
1618
-
1619
- #navigation-edge {
1620
- display: none;
1621
- }
1622
-
1623
- /* fullbleed #main */
1624
- #main {
1625
- padding-left: 0;
1626
- padding-right: 0;
1627
- }
1628
-
1629
- .viewport-medium-10 #main {
1630
- width: 100%;
1631
- max-width: 100%;
1632
- }
1633
-
1634
- /* constrain template containers */
1635
- .ad.top-ad {
1636
- margin-left: 0;
1637
- margin-right: 0;
1638
- }
1639
-
1640
- .story-header.interactive-header,
1641
- .story.theme-main .story-footer,
1642
- .related-coverage {
1643
- margin-left: 10px;
1644
- margin-right: 10px;
1645
- }
1646
-
1647
- .viewport-medium-10 .ad.top-ad,
1648
- .viewport-medium-10 .story-header.interactive-header,
1649
- .viewport-medium-10 .story.theme-main .story-footer,
1650
- .viewport-medium-10 .related-coverage {
1651
- max-width: 720px;
1652
- margin-left: auto;
1653
- margin-right: auto;
1654
- }
1655
-
1656
- .viewport-medium-30 .ad.top-ad,
1657
- .viewport-medium-30 .story-header.interactive-header,
1658
- .viewport-medium-30 .story.theme-main .story-footer,
1659
- .viewport-medium-30 .related-coverage {
1660
- max-width: 945px;
1661
- }
1662
-
1663
- .viewport-large-30 .ad.top-ad,
1664
- .viewport-large-30 .story-header.interactive-header,
1665
- .viewport-large-30 .story.theme-main .story-footer,
1666
- .viewport-large-30 .related-coverage {
1667
- max-width: 1050px;
1668
- }
1669
-
1670
- .g-body, .g-map-key, .g-asset-source, .g-table-container, .g-column-container, .g-asset-hed {
1671
- padding-left: 10px;
1672
- padding-right: 10px;
1673
- }
1674
-
1675
- .viewport-large .g-body,
1676
- .viewport-large .g-map-key,
1677
- .viewport-large .g-asset-source,
1678
- .viewport-large .g-table-container,
1679
- .viewport-large .g-column-container,
1680
- .viewport-large .g-asset-hed {
1681
- padding-left: 0;
1682
- padding-right: 0;
1683
- }
1684
-
1685
- /* For use with LaziestLoader */
1686
- /* @import (inline) "nyt5/laziestloader.css"; */
1687
- /* Fix spacing at top of story */
1688
- .has-top-ad .story.theme-interactive,
1689
- .has-ribbon .story.theme-interactive {
1690
- margin-top: 10px;
1691
- }
1692
-
1693
- /* Fix comments button margin */
1694
- .story.theme-interactive .comments-button.theme-kicker {
1695
- margin-top: 0;
1696
- }
1697
-
1698
- /* Get rid of border under intro and share tools on mobile */
1699
- .page-interactive-default .story.theme-main .story-header {
1700
- border-bottom: none;
1701
- }
1702
-
1703
- /* Pad out the kicker/sharetool space */
1704
- .story.theme-interactive .story-meta .kicker {
1705
- margin-bottom: 22px;
1706
- }
1707
-
1708
- .viewport-medium-10 .story.theme-interactive .story-meta .kicker {
1709
- margin-bottom: 24px;
1710
- }
1711
-
1712
- /* Override the moving sharetools on mobile */
1713
- .story.theme-interactive .story-header .story-meta .kicker-container .sharetools {
1714
- position: relative;
1715
- left: auto;
1716
- bottom: auto;
1717
- width: auto;
1718
- margin-top: -6px;
1719
- float: right;
1720
- clear: none;
1721
- }
1722
-
1723
- /* Maintain the proper space with the section name and kicker next to share tools */
1724
- .story.theme-interactive .story-header .story-meta .interactive-kicker {
1725
- float: left;
1726
- width: 65%;
1727
- display: inline-block;
1728
- }
1729
-
1730
- /* Gets rid of the extra space under the intro that puts too much space there in mobile and desktop */
1731
- .page-interactive-default .story.theme-main .story-header {
1732
- margin-bottom: 0;
1733
- }
1734
-
1735
- .page-interactive-default .story.theme-main .story-header .story-meta {
1736
- margin-bottom: 10px;
1737
- }
1738
-
1739
- /*Fixes styling on share tools at bottom of minimal interactives*/
1740
- .story.theme-minimal .sharetools.layout-horizontal{
1741
- width:auto;
1742
- margin-top:11px;
1743
- }
1744
- .story.theme-minimal .sharetools.layout-horizontal .sharetool {
1745
- display: inline-block;
1746
- border-top: 0;
1747
- }
1748
- .story.theme-minimal .sharetools.layout-horizontal .sharetool:first-child a {
1749
- margin-left: 0;
1750
- padding-left: 0;
1751
- border-left: none;
1752
- }
1753
- .story.theme-minimal .sharetools.layout-horizontal .sharetool a {
1754
- padding-left: 15px;
1755
- padding-right: 5px;
1756
- height: 20px;
1757
- border-left: 1px solid #e2e2e2;
1758
- }
1759
- .story.theme-minimal .sharetools.layout-horizontal .sharetool a:hover {
1760
- background-color: transparent;
1761
- }
1762
-
1763
- /* uncomment to fix related content and footer layout on max_width: 720 pages */
1764
- /*
1765
- .related-coverage {
1766
- max-width: 720px;
1767
- }
1768
-
1769
- .viewport-medium-30 .page-footer nav ul,
1770
- .viewport-medium-50 .page-footer nav ul {
1771
- margin-left: 28px;
1772
- }
1773
-
1774
- .viewport-medium-30 .page-footer nav.last-nav {
1775
- float: none;
1776
- }
1777
-
1778
- .viewport-medium-30 .page-footer nav.last-nav ul {
1779
- margin-left: 239px;
1780
- }
1781
- */
1782
-
1783
- .g-subhed h2 {
1784
- font: 300 24px/1.2 'nyt-franklin', Arial, sans-serif;
1785
- margin-bottom: 0.65em;
1786
- }
1787
- .viewport-small-10 .g-subhed h2 {
1788
- font-size: 28px;
1789
- }
1790
- .g-animation {
1791
- margin: 0 -15px;
1792
- max-width: calc(130%);
1793
- }
1794
- @media (min-width: 780px) {
1795
- .g-animation {
1796
- margin: 0;
1797
- }
1798
- }
1799
- .g-locator {
1800
- max-width: 300px;
1801
- margin: 100px auto 30px auto;
1802
- }
1803
- .g-locator .g-locator-in {
1804
- display: inline-block;
1805
- width: 120px;
1806
- vertical-align: middle;
1807
- z-index: -1;
1808
- position: relative;
1809
- overflow: hidden;
1810
- }
1811
- .viewport-medium .g-locator .g-locator-in {
1812
- margin: 0 -10px 0 -20px;
1813
- }
1814
- .g-locator .g-subhed {
1815
- display: inline-block;
1816
- width: calc(100% - 130px);
1817
- vertical-align: middle;
1818
- z-index: 100;
1819
- position: relative;
1820
- }
1821
- .g-request p.g-body {
1822
- padding: 8px 16px;
1823
- border-radius: 3px;
1824
- box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.15);
1825
- border: 1px solid #e4e4e4;
1826
- font: 300 16px/1.4 'nyt-franklin', Arial, sans-serif;
1827
- }
1828
- div.tooltip {
1829
- top: -1000px;
1830
- position: fixed;
1831
- padding: 5px;
1832
- background: rgba(255, 255, 255, 0.95);
1833
- border: 1px solid lightgray;
1834
- pointer-events: none;
1835
- width: 300px;
1836
- font: 300 14px / 1.2 'nyt-franklin', Arial, sans-serif;
1837
- }
1838
- .tooltip-hidden {
1839
- opacity: 0;
1840
- transition: all .3s;
1841
- transition-delay: .1s;
1842
- }
1843
- @media (max-width: 590px) {
1844
- div.tooltip {
1845
- bottom: -1px;
1846
- width: calc(100%);
1847
- left: -1px !important;
1848
- right: -1px !important;
1849
- top: auto !important;
1850
- width: auto !important;
1851
- }
1852
- }
1853
- #g-harvey_basemap-box {
1854
- position: relative;
1855
- }
1856
- #g-houston-rescue-map-box {
1857
- position: absolute;
1858
- top: 0px;
1859
- font: 300 15px / 1.2 'nyt-franklin';
1860
- }
1861
- #g-houston-rescue-map-box .g-key {
1862
- width: 200px;
1863
- text-align: center;
1864
- position: absolute;
1865
- bottom: 50px;
1866
- right: 4px;
1867
- font-size: 20px;
1868
- font-weight: 600;
1869
- }
1870
- #g-houston-rescue-map-box .g-key p {
1871
- font: 300 15px / 1.2 'nyt-franklin';
1872
- display: inline-block;
1873
- margin-bottom: 0px;
1874
- }
1875
- #g-houston-rescue-map-box .g-key .g-key-circle {
1876
- width: 9px;
1877
- height: 9px;
1878
- display: inline-block;
1879
- margin-right: 8px;
1880
- position: relative;
1881
- top: -2px;
1882
- border-radius: 100%;
1883
- }
1884
- .description {
1885
- margin-left: 10px;
1886
- font-size: 15px;
1887
- line-height: 15px;
1888
- max-width: 150px;
1889
- padding: 8px 12px;
1890
- color: #000;
1891
- border-radius: 3px;
1892
- background: #ffffff;
1893
- box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.33);
1894
- }
1895
- .description:after {
1896
- content: '';
1897
- position: absolute;
1898
- left: 0;
1899
- top: 50%;
1900
- width: 0;
1901
- height: 0;
1902
- border: 5px solid transparent;
1903
- border-right-color: #ffffff;
1904
- border-left: 0;
1905
- margin-top: -5px;
1906
- margin-left: -5px;
1907
- }
1908
- .description.lefty:after {
1909
- position: absolute;
1910
- left: auto;
1911
- right: 0;
1912
- top: 50%;
1913
- width: 0;
1914
- height: 0;
1915
- border: 5px solid transparent;
1916
- border-left-color: #ffffff;
1917
- box-shadow: none;
1918
- border-right: 0;
1919
- margin-top: -5px;
1920
- margin-right: -5px;
1921
- }
1922
- .hpgraphic {
1923
- width: 573px;
1924
- position: relative;
1925
- z-index: 3;
1926
- min-height: 322px;
1927
- background: #eee;
1928
- }
1929
- .hpgraphic .g-item-ai2html {
1930
- margin: 0;
1931
- }
1932
- .hpgraphic .description {
1933
- font-size: 13px;
1934
- border-radius: 2px;
1935
- padding: 2px 5px;
1936
- }
1937
- .g-timer {
1938
- opacity: 0;
1939
- }
1940
- .g-text strong,
1941
- .g-text b {
1942
- font-family: 'nyt-franklin', arial, sans-serif;
1943
- }
1944
- </style>
1945
-
1946
- <a href="https://www.nytimes.com/interactive/2017/08/30/us/houston-flood-rescue-cries-for-help.html">
1947
- <div class="g-graphic hpgraphic g-graphic-freebird" data-preview-slug="2017-08-30-houston-rescues">
1948
-
1949
- <div class="g-item-ai2html" style="max-width:573px;">
1950
-
1951
-
1952
-
1953
-
1954
-
1955
- <!-- SCOOP CSS -->
1956
- <!-- Generated by ai2html v0.65.5 - 2017-08-31 01:22 -->
1957
- <!-- ai file: harvey_hp.ai -->
1958
- <!-- preview: 2017-08-30-houston-rescues -->
1959
- <!-- scoop: houston-rescues-animation-573 -->
1960
- <style type='text/css' media='screen,print'>
1961
- #g-harvey_hp-Artboard_2-box {
1962
- max-width:600px;
1963
- }
1964
- #g-harvey_hp-Artboard_2-box .g-artboard {
1965
- margin:0 auto;
1966
- }
1967
- #g-harvey_hp-Artboard_2-box .g-artboard p {
1968
- margin:0;
1969
- }
1970
- .g-aiAbs {
1971
- position:absolute;
1972
- }
1973
- .g-aiImg {
1974
- display:block;
1975
- width:100% !important;
1976
- }
1977
- .g-aiPointText p { white-space: nowrap; }
1978
- #g-harvey_hp-Artboard_2 {
1979
- position:relative;
1980
- overflow:hidden;
1981
- width:573px;
1982
- }
1983
- #g-harvey_hp-Artboard_2 p {
1984
- font-family:nyt-franklin,arial,helvetica,sans-serif;
1985
- font-weight:500;
1986
- font-size:13px;
1987
- line-height:17px;
1988
- filter:alpha(opacity=100);
1989
- -ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
1990
- opacity:1;
1991
- letter-spacing:0.2em;
1992
- text-align:left;
1993
- color:rgb(156,156,156);
1994
- text-transform:none;
1995
- padding-bottom:0;
1996
- padding-top:0;
1997
- mix-blend-mode:normal;
1998
- font-style:normal;
1999
- }
2000
- #g-harvey_hp-Artboard_2 .g-pstyle0 {
2001
- font-weight:700;
2002
- font-size:21px;
2003
- line-height:23px;
2004
- filter:alpha(opacity=70);
2005
- -ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
2006
- opacity:0.7;
2007
- letter-spacing:0em;
2008
- color:rgb(0,0,0);
2009
- }
2010
- #g-harvey_hp-Artboard_2 .g-pstyle1 {
2011
- text-align:center;
2012
- }
2013
- #g-harvey_hp-Artboard_2 .g-pstyle2 {
2014
- font-weight:300;
2015
- font-style:italic;
2016
- filter:alpha(opacity=40);
2017
- -ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
2018
- opacity:0.4;
2019
- mix-blend-mode:multiply;
2020
- letter-spacing:0.3em;
2021
- text-align:center;
2022
- color:rgb(5,96,147);
2023
- }
2024
- #g-harvey_hp-Artboard_2 .g-pstyle3 {
2025
- font-weight:300;
2026
- font-size:15px;
2027
- line-height:23px;
2028
- letter-spacing:0em;
2029
- color:rgb(0,0,0);
2030
- }
2031
- #g-harvey_hp-Artboard_2 .g-pstyle4 {
2032
- font-weight:300;
2033
- font-size:12px;
2034
- line-height:23px;
2035
- filter:alpha(opacity=60);
2036
- -ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
2037
- opacity:0.6;
2038
- letter-spacing:0em;
2039
- color:rgb(0,0,0);
2040
- }
2041
-
2042
- </style>
2043
-
2044
- <!-- SCOOP HTML -->
2045
- <!-- Generated by ai2html v0.65.5 - 2017-08-31 01:22 -->
2046
- <!-- ai file: harvey_hp.ai -->
2047
- <!-- preview: 2017-08-30-houston-rescues -->
2048
- <!-- scoop: houston-rescues-animation-573 -->
2049
- <div id="g-harvey_hp-Artboard_2-box" class="ai2html">
2050
-
2051
- <!-- Artboard: Artboard_2 -->
2052
- <div id="g-harvey_hp-Artboard_2" class="g-artboard g-artboard-v3">
2053
- <img id="g-ai0-0" class="g-aiImg" src="https://static01.nyt.com/newsgraphics/2017/08/30/houston-rescues/3217ab7ea858a2c388ceacbca5f753f34faf5343/harvey_hp-Artboard_2.png"/>
2054
- <div id="timer" class="g-timer g-aiAbs g-aiPointText" style="top:10.2033%;margin-top:-11.9px;left:5.2511%;width:150px;">
2055
- <p class="g-pstyle0">12 a.m. Monday</p>
2056
- </div>
2057
- <div id="g-ai0-2" class="g-text g-aiAbs g-aiPointText" style="top:31.0397%;margin-top:-8.9px;left:75.3489%;margin-left:-7.8534%;width:92px;">
2058
- <p class="g-pstyle1">BEAUMONT</p>
2059
- </div>
2060
- <div id="g-ai0-3" class="g-text g-aiAbs g-aiPointText" style="top:45.0983%;margin-top:-17.2px;left:81.9842%;margin-left:-5.6719%;width:67px;">
2061
- <p class="g-pstyle1">PORT</p>
2062
- <p class="g-pstyle1">ARTHUR</p>
2063
- </div>
2064
- <div id="g-ai0-4" class="g-text g-aiAbs g-aiPointText" style="top:60.5454%;margin-top:-8.9px;left:28.1349%;margin-left:-6.719%;width:79px;">
2065
- <p class="g-pstyle1">HOUSTON</p>
2066
- </div>
2067
- <div id="g-ai0-5" class="g-text g-aiAbs g-aiPointText" style="top:72.8327%;margin-top:-17.5px;left:82.169%;margin-left:-6.8063%;width:80px;">
2068
- <p class="g-pstyle2">GULF OF</p>
2069
- <p class="g-pstyle2">MEXICO</p>
2070
- </div>
2071
- <div id="g-ai0-6" class="g-text g-aiAbs g-aiPointText" style="top:93.7756%;margin-top:-11.9px;left:79.5415%;width:102px;">
2072
- <p class="g-pstyle3">Rescue request</p>
2073
- </div>
2074
- <div id="g-ai0-7" class="g-text g-aiAbs g-aiPointText" style="top:93.4021%;margin-top:-11.7px;left:1.6973%;width:45px;">
2075
- <p class="g-pstyle4">10 miles</p>
2076
- </div>
2077
- </div>
2078
-
2079
- </div>
2080
-
2081
-
2082
-
2083
-
2084
-
2085
- </div>
2086
-
2087
- </div>
2088
- </a>
2089
-
2090
- <script>
2091
- define('_nytg/2017-08-30-houston-rescues/assets', function() { return 'https://static01.nyt.com/newsgraphics/2017/08/30/houston-rescues/3217ab7ea858a2c388ceacbca5f753f34faf5343/'; });
2092
- define('_nytg/2017-08-30-houston-rescues/big-assets', function() { return 'https://static01.nyt.com/newsgraphics/2017/08/30/houston-rescues/assets/'; });
2093
-
2094
- require(['foundation/main'], function() {
2095
- require(['https://static01.nyt.com/newsgraphics/2017/08/30/houston-rescues/3217ab7ea858a2c388ceacbca5f753f34faf5343/build.js']); // generated from src/script.js
2096
- });
2097
- </script>
2098
- <!-- Pipeline: 2017-08-30-houston-rescues August 31, 2017, 01:24AM 3217ab7ea858a2c388ceacbca5f753f34faf5343 --></div>
2099
- <div class="collection">
2100
- <div class="photo-spot-region"><div class="story theme-summary lede"><article class="story theme-summary" id="topnews-100000005401681" data-story-id="100000005401681" data-rank="1" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
2101
-
2102
- <h2 class="story-heading"><a href="https://www.nytimes.com/interactive/2017/08/30/us/houston-flood-rescue-cries-for-help.html">‘Running Out of Time’</a></h2>
2103
-
2104
-
2105
- <p class="summary">As Houston was overcome by floodwaters, thousands of people cried out for help online.</p>
2106
-
2107
-
2108
- </article>
2109
- </div></div></div>
2110
- <div class="collection">
2111
- <div style="margin-top: +5px;"></div></div>
2112
- <div class="collection">
2113
- <hr class="single-rule" />
2114
- </div>
2115
- <div class="collection">
2116
- <style>
2117
- .nythpSplitCode .column { margin-left: 21px; }
2118
- .nythpSplitCode .column:first-child { margin-left: 0px; }
2119
- .nythpSplitCode.layout { background: none; }
2120
- .nythpSplitCode .media.photo.medium-thumb { float: none; margin-left: 0; }
2121
- </style>
2122
-
2123
- <div class="layout nythpSplitCode wide-b-layout">
2124
- <div class="column"><div></div>
2125
- <div class="collection">
2126
- <article class="story theme-summary" id="topnews-100000005400393" data-story-id="100000005400393" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
2127
-
2128
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/victims-harvey-death-toll-houston.html">Clinging to Her Drowning Mother, a Girl Survives</a></h2>
2129
-
2130
- <p class="byline">By SIMON ROMERO and JULIE BOSMAN </p>
2131
-
2132
- <p class="summary">“Mama was saying her prayers,” 3-year-old Jordyn Grace told a relative.</p>
2133
-
2134
-
2135
- </article>
2136
- </div>
2137
- <div class="collection headlines">
2138
- <ul class="theme-news-headlines">
2139
- <li>
2140
- <div style="margin-top: -10px;"></div> </li>
2141
- <li>
2142
- <article class="story" id="topnews-100000005400407" data-story-id="100000005400407" data-rank="1" data-collection-renderstyle="HpBlogHeadline">
2143
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/us/harvey-death-toll.html">Stories Emerge of Harvey’s Victims as Death Toll Rises</a></h2>
2144
- </article>
2145
- </li>
2146
- <li>
2147
- <article class="story" id="topnews-100000005398786" data-story-id="100000005398786" data-rank="2" data-collection-renderstyle="HpBlogHeadline">
2148
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/us/hurricane-center-timeline.html">From Forecast to Disaster: A Timeline</a></h2>
2149
- </article>
2150
- </li>
2151
- </ul>
2152
- </div>
2153
- <div class="collection">
2154
- </div></div>
2155
- <div class="column b-column"><div></div>
2156
- <div class="collection">
2157
- <article class="story theme-summary" id="topnews-100000005401072" data-story-id="100000005401072" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
2158
-
2159
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/houston-flooding-growth-regulation.html">Houston, the Limitless City, Is Forced to Consider Its Limits</a></h2>
2160
-
2161
- <p class="byline">By MANNY FERNANDEZ and RICHARD FAUSSET </p>
2162
-
2163
- <p class="summary">A muscular metropolitan area that embraced growth now wonders whether growth made its flooding woes worse.</p>
2164
-
2165
-
2166
- </article>
2167
- </div>
2168
- <div class="collection headlines">
2169
- <ul class="theme-news-headlines">
2170
- <li>
2171
- <div style="margin-top: -10px;"></div> </li>
2172
- <li>
2173
- <article class="story" id="topnews-100000005396839" data-story-id="100000005396839" data-rank="1" data-collection-renderstyle="HpBlogHeadline">
2174
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/business/harvey-recovery-houston-businesses.html">After Harvey, Will Big Business Repay Houston’s Generosity?</a></h2>
2175
- </article>
2176
- </li>
2177
- </ul>
2178
- </div>
2179
- <div class="collection">
2180
- <article class="story theme-summary" id="topnews-100000005400885" data-story-id="100000005400885" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
2181
-
2182
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/business/harvey-aid-sba-disaster-loans.html">Victims Face Hurdles, and Maybe Bills, in Getting Aid</a></h2>
2183
-
2184
- <p class="byline">By STACY COWLEY </p>
2185
-
2186
- <p class="summary">Thousands are applying for federal assistance, but it may be slow to arrive and require them to take on debt.</p>
2187
-
2188
-
2189
- </article>
2190
- </div>
2191
- <div class="collection headlines">
2192
- <ul class="theme-news-headlines">
2193
- <li>
2194
- <div style="margin-top: -10px;"></div> </li>
2195
- <li>
2196
- <article class="story" id="topnews-100000005396158" data-story-id="100000005396158" data-rank="1" data-collection-renderstyle="HpBlogHeadline">
2197
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/28/us/donate-harvey-charities-scams.html">Where to Donate to Storm Victims (and How to Avoid Scams)</a></h2>
2198
- </article>
2199
- </li>
2200
- </ul>
2201
- </div>
2202
- <div class="collection">
2203
- </div></div>
2204
- <div class="column"><div></div>
2205
- <div class="collection">
2206
- </div></div></div></div>
2207
- <div class="collection">
2208
- </div></div></div>
2209
- <div class="column megaSPanC"><div></div>
2210
- <div class="collection">
2211
- <style type="text/css">
2212
- .paywall-hp-note {
2213
- padding: 13px 15px 12px 15px;
2214
- background-color: #f7f7f7;
2215
- border-radius: 2px;
2216
- margin-bottom: 18px;
2217
- }
2218
- .paywall-hp-note:after {
2219
- content: "";
2220
- display: table;
2221
- clear: both;
2222
- }
2223
- .paywall-hp-note h5,
2224
- .paywall-hp-note p {
2225
- font: 400 14px/16px 'nyt-cheltenham-sh',georgia,'times new roman',serif;
2226
- color: #808080;
2227
- -webkit-font-smoothing: antialiased;
2228
- }
2229
- .paywall-hp-note h5 {
2230
- font-weight: 700;
2231
- color: #4d4d4d;
2232
- margin-bottom: 9px;
2233
- }
2234
- .paywall-hp-note p {
2235
- font-style: italic;
2236
- margin-bottom: 0;
2237
- }
2238
- </style>
2239
- <div class="paywall-hp-note">
2240
- <h5>To Our Readers</h5>
2241
- <p>The Times is providing free digital access to coverage of the storm.</p>
2242
- </div></div>
2243
- <div class="collection">
2244
- <hr class="single-rule" style="width: 50%; text-align: center; margin: 12px auto 0;" />
2245
-
2246
- </div>
2247
- <div class="collection">
2248
- <article class="story theme-summary" id="topnews-100000005399973" data-story-id="100000005399973" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
2249
-
2250
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/port-arthur-flooding.html">Port Arthur Overcome by Instant Flooding: ‘Our Whole City Is Underwater’</a></h2>
2251
-
2252
- <p class="byline">By JONAH ENGEL BROMWICH </p>
2253
-
2254
- <p class="summary">Jefferson County, Tex., about 100 miles east of Houston, was “slammed with 20 inches of rainfall” overnight. Thousands of people were stranded on their roofs, on top of cars and in attics.</p>
2255
-
2256
-
2257
- </article>
2258
- </div>
2259
- <div class="collection">
2260
- <figure class="story theme-feature video media video-promo-small updated-video-promo-small">
2261
- <a href="https://www.nytimes.com/video/us/100000005400001/harvey-houston-port-arthur-flooding.html">
2262
- <div class="video-promo-small-container" style="background-image: url('https://static01.nyt.com/images/2017/08/31/us/31storm4_xp/31storm4_xp-filmstrip.jpg');">
2263
- <div class="metadata">
2264
- <div class="play-button-and-duration">
2265
- <div class="play-icon">
2266
- <svg class="play-circle" height="28" width="28">
2267
- <circle cx="14" cy="14" r="13" stroke="#FFF" fill="transparent" stroke-width="1.5" />
2268
- </svg>
2269
- <svg version="1.2" class="play-triangle" height="10" width="10">
2270
- <polyline points="5,1.2264973081037427 10,9.88675134594813 0,9.88675134594813" transform="rotate(90, 5, 5)"></polyline>
2271
- </svg>
2272
- </div>
2273
- <div class="duration">
2274
- <span>1:36</span>
2275
- </div>
2276
- </div>
2277
- <h2 class="story-heading">
2278
- Path of Destruction Continues </h2>
2279
- <div class="orientation-icon">
2280
- <svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink">
2281
- <g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
2282
- <g id="Compass-Cover-ACol">
2283
- <g id="360-View-Indicator">
2284
- <circle id="Oval-44" fill-opacity="0.1" fill="#000000" cx="14" cy="14" r="12.75"></circle>
2285
- <path d="M14,28 C21.7319865,28 28,21.7319865 28,14 C28,6.2680135 21.7319865,0 14,0 C6.2680135,0 0,6.2680135 0,14 C0,21.7319865 6.2680135,28 14,28 Z M14,26.75 C21.0416306,26.75 26.75,21.0416306 26.75,14 C26.75,6.95836944 21.0416306,1.25 14,1.25 C6.95836944,1.25 1.25,6.95836944 1.25,14 C1.25,21.0416306 6.95836944,26.75 14,26.75 Z" id="Border" fill="#FFFFFF"></path>
2286
- <g id="eyes" transform="translate(9.488845, 14.454531)" fill="#FFFFFF">
2287
- <ellipse id="Oval-12" cx="2.01115463" cy="2.04546933" rx="1.5" ry="1.5"></ellipse>
2288
- <ellipse id="Oval-12-Copy" cx="7.01115463" cy="2.04546933" rx="1.5" ry="1.5"></ellipse>
2289
- </g>
2290
- <path d="M13.9960842,13 L21.5,5.88357462 C19.5796583,4.05113973 16.9264365,3 13.9960843,3 C11.065732,3 8.42034167,4.05113973 6.5,5.88357462 L13.9960842,13 Z" id="view" fill="#FFFFFF"></path>
2291
- </g>
2292
- </g>
2293
- </g>
2294
- </svg>
2295
- </div>
2296
- </div>
2297
- </div>
2298
- </a>
2299
- <figcaption class="caption">
2300
- <p class="credit">By MALACHY BROWNE, BARBARA MARCOLINI and CHRIS CIRILLO</p>
2301
- </figcaption>
2302
- </figure>
2303
- </div>
2304
- <div class="collection headlines">
2305
- <ul class="theme-news-headlines">
2306
- <li>
2307
- <article class="story" id="topnews-100000005398038" data-story-id="100000005398038" data-rank="0" data-collection-renderstyle="HpBlogHeadline">
2308
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/29/us/harvey-email-callout.html">Are You Affected? We Want to Hear From You</a></h2>
2309
- </article>
2310
- </li>
2311
- </ul>
2312
- </div>
2313
- <div class="collection">
2314
- </div></div>
2315
-
2316
- <div style="background-color: #fff;"><div></div>
2317
- </div>
2318
- </div>
2319
- </div></div>
2320
- <div class="collection">
2321
- <script>function getFlexData() { return {"data":{"item":[{"thumb":"https:\/\/static01.nyt.com\/images\/2017\/09\/01\/science\/01WATER1\/01WATER1-videoSixteenByNine310.jpg","type":"article","headline":"A Sea of Hazards in Floodwaters","link":"https:\/\/www.nytimes.com\/2017\/08\/31\/us\/houston-contaminated-floodwaters.html"},{"thumb":"https:\/\/static01.nyt.com\/images\/2017\/08\/31\/insider\/mattress-mack\/mattress-mack-videoSixteenByNine310.jpg","type":"video","headline":"A Mattress Store Turned Shelter","link":"https:\/\/www.nytimes.com\/video\/us\/100000005398367\/houston-harvey-mattress-shelter.html"},{"thumb":"https:\/\/static01.nyt.com\/images\/2017\/08\/31\/us\/stormpics74\/stormpics74-videoSixteenByNine310.jpg","type":"slideshow","headline":"Harvey in Pictures","link":"https:\/\/www.nytimes.com\/2017\/08\/27\/us\/harvey-pictures-hurricane-storm.html?mcubz=0&_r=0"},{"thumb":"https:\/\/static01.nyt.com\/images\/2017\/08\/31\/dining\/360-tamircover\/360-tamircover-videoSixteenByNine310.jpg","type":"video","headline":"The Daily 360: Submerged Streets ","link":"https:\/\/www.nytimes.com\/video\/us\/100000005399523\/harvey-houston-flooding-rescue.html"}]}}; }var NYTD=NYTD || {}; NYTD.FlexTypes = NYTD.FlexTypes || []; NYTD.FlexTypes.push({"target":"FT100000005396835","type":"HP Thumbstrip","data":{"item":[{"thumb":"https:\/\/static01.nyt.com\/images\/2017\/09\/01\/science\/01WATER1\/01WATER1-videoSixteenByNine310.jpg","type":"article","headline":"A Sea of Hazards in Floodwaters","link":"https:\/\/www.nytimes.com\/2017\/08\/31\/us\/houston-contaminated-floodwaters.html"},{"thumb":"https:\/\/static01.nyt.com\/images\/2017\/08\/31\/insider\/mattress-mack\/mattress-mack-videoSixteenByNine310.jpg","type":"video","headline":"A Mattress Store Turned Shelter","link":"https:\/\/www.nytimes.com\/video\/us\/100000005398367\/houston-harvey-mattress-shelter.html"},{"thumb":"https:\/\/static01.nyt.com\/images\/2017\/08\/31\/us\/stormpics74\/stormpics74-videoSixteenByNine310.jpg","type":"slideshow","headline":"Harvey in Pictures","link":"https:\/\/www.nytimes.com\/2017\/08\/27\/us\/harvey-pictures-hurricane-storm.html?mcubz=0&_r=0"},{"thumb":"https:\/\/static01.nyt.com\/images\/2017\/08\/31\/dining\/360-tamircover\/360-tamircover-videoSixteenByNine310.jpg","type":"video","headline":"The Daily 360: Submerged Streets ","link":"https:\/\/www.nytimes.com\/video\/us\/100000005399523\/harvey-houston-flooding-rescue.html"}]}});</script><link rel="stylesheet" type="text/css" href="https://static01.nyt.com/newsgraphics/2015/hp-thumbstrip/assets/build.css" />
2322
- <style>
2323
- .nytd-hp-thumbstrip{ display:flex; }
2324
- .nytd-hp-thumbstrip .ts-link{ width:100%; }
2325
- .nytd-hp-thumbstrip .ts-link .ts-item{ width:94%; }
2326
- </style>
2327
-
2328
- <script>
2329
- var NYTG_ASSETS = "_assets/";
2330
- var NYTG_BIG_ASSETS = "_big_assets/";
2331
- require(['foundation/main'], function() {
2332
- require(["https://static01.nyt.com/newsgraphics/2015/hp-thumbstrip/assets/build.js"]);
2333
- });
2334
- </script><div id="FT100000005396835"></div></div>
2335
- <div class="collection">
2336
- <hr class="scotch-rule" /></div>
2337
- </div><!-- close span-abc-region -->
2338
-
2339
- <div class="span-ab-layout layout">
2340
-
2341
- <div class="ab-column column">
2342
-
2343
- <section id="top-news" class="top-news">
2344
- <h2 class="section-heading visually-hidden">Top News</h2>
2345
-
2346
-
2347
-
2348
-
2349
- <div class="wide-b-layout layout">
2350
-
2351
- <div class="a-column column">
2352
-
2353
- <div class="first-column-region region">
2354
-
2355
- <div class="collection">
2356
- <article class="story theme-summary" id="topnews-100000005399055" data-story-id="100000005399055" data-rank="0" data-collection-renderstyle="HpSumSmallMedia">
2357
-
2358
-
2359
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/politics/trump-missouri-tax-plan.html">Trump Pitches Tax Cuts on Business as Aiding Middle Class</a></h2>
2360
-
2361
- <p class="byline">By JULIE HIRSCHFELD DAVIS and BINYAMIN APPELBAUM </p>
2362
-
2363
- <div class="thumb">
2364
- <a href="https://www.nytimes.com/2017/08/30/us/politics/trump-missouri-tax-plan.html"><img src="https://static01.nyt.com/images/2017/08/31/us/31dc-trump-promo/31dc-trump-promo-thumbStandard.jpg" alt=""></a>
2365
- </div>
2366
-
2367
- <p class="summary">
2368
- In a speech on Wednesday in Springfield, Mo., President Trump laid out the case for cutting taxes for businesses and individuals and for simplifying the tax code. </p>
2369
-
2370
- <p class="theme-comments">
2371
- <a href="https://www.nytimes.com/2017/08/30/us/politics/trump-missouri-tax-plan.html?hp&amp;target=comments#commentsContainer" class="comments-link"><i class="icon sprite-icon comments-icon"></i><span class="comment-count">&nbsp;Comments</span></a>
2372
- </p>
2373
-
2374
- </article>
2375
-
2376
- </div>
2377
- <div class="collection">
2378
- <article class="story theme-summary" id="topnews-100000005398833" data-story-id="100000005398833" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
2379
-
2380
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/29/business/economy/trump-corporate-tax-plan.html">Trump Tax Plan May Free Corporate Dollars. Then What?</a></h2>
2381
-
2382
- <p class="byline">By PATRICIA COHEN </p>
2383
-
2384
- <p class="summary">Republicans are promising to stimulate investment and create jobs. But steps to undo tax dodges may not produce the intended economic lift.</p>
2385
-
2386
- <p class="theme-comments">
2387
- <a href="https://www.nytimes.com/2017/08/29/business/economy/trump-corporate-tax-plan.html?hp&amp;target=comments#commentsContainer" class="comments-link"><i class="icon sprite-icon comments-icon"></i><span class="comment-count">&nbsp;Comments</span></a>
2388
- </p>
2389
-
2390
- </article>
2391
- </div>
2392
- <hr class="single-rule" /><div class="collection">
2393
- <article class="story theme-summary" id="topnews-100000005401510" data-story-id="100000005401510" data-rank="0" data-collection-renderstyle="HpSumMediumMedia" data-start-time="" data-end-time="">
2394
-
2395
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/judge-texas-sanctuary-cities.html">Federal Judge Blocks Texas’ Ban on ‘Sanctuary Cities’</a></h2>
2396
-
2397
- <p class="byline">By MANNY FERNANDEZ </p>
2398
-
2399
- <p class="summary">
2400
- The temporary ruling prevents the state from going ahead with provisions that were to go into effect on Friday. </p>
2401
-
2402
-
2403
-
2404
- <figure class="media photo medium-thumb">
2405
- <div class="image">
2406
- <a href="https://www.nytimes.com/2017/08/30/us/judge-texas-sanctuary-cities.html"><img src="https://static01.nyt.com/images/2017/08/31/us/31sanctuary/31sanctuary-mediumFlexible177.jpg" alt="" /></a>
2407
- </div>
2408
- </figure>
2409
- </article>
2410
- </div>
2411
- <hr class="single-rule" /><div class="collection">
2412
- <article class="story theme-summary" id="topnews-100000005401018" data-story-id="100000005401018" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
2413
-
2414
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/politics/trump-obamacare-enrollment-markets-subsidies.html">Seeking to Stabilize Health Markets, but Offering Few Details</a></h2>
2415
-
2416
- <p class="byline">By ROBERT PEAR </p>
2417
-
2418
- <p class="summary">A Trump administration official refused to say what, if anything, the government would do to encourage people to sign up for health insurance under the Affordable Care Act.</p>
2419
-
2420
-
2421
- </article>
2422
- </div>
2423
- <hr class="single-rule" /><div class="collection">
2424
- <article class="story theme-summary" id="topnews-100000005399964" data-story-id="100000005399964" data-rank="0" data-collection-renderstyle="HpSumMediumMedia" data-start-time="" data-end-time="">
2425
-
2426
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/us/politics/trump-north-korea-extortion-money.html">On North Korea, Trump Says ‘Talking Is Not the Answer!’</a></h2>
2427
-
2428
- <p class="byline">By MARK LANDLER </p>
2429
-
2430
- <p class="summary">
2431
- While Mr. Trump’s threats against North Korea have been unnerving, it is the prospect of a risky dialogue that most unsettles former officials. </p>
2432
-
2433
-
2434
-
2435
- <figure class="media photo medium-thumb">
2436
- <div class="image">
2437
- <a href="https://www.nytimes.com/2017/08/30/us/politics/trump-north-korea-extortion-money.html"><img src="https://static01.nyt.com/images/2017/08/31/us/31dc-prexy1/merlin-to-scoop-126571670-887690-mediumFlexible177.jpg" alt="" /></a>
2438
- </div>
2439
- </figure>
2440
- </article>
2441
- </div>
2442
- <div class="collection headlines">
2443
- <h3 class="kicker collection-kicker">More in Politics</h3>
2444
- <ul class="theme-news-headlines">
2445
- <li>
2446
- <article class="story" id="topnews-100000005400483" data-story-id="100000005400483" data-rank="0" data-collection-renderstyle="HpHeadline">
2447
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/us/politics/trump-russia-michael-cohen.html">Trump Lawyer ‘Vehemently’ Denies Russian Collusion</a> </h2>
2448
- </article>
2449
- </li>
2450
- <li>
2451
- <article class="story" id="topnews-100000005401238" data-story-id="100000005401238" data-rank="1" data-collection-renderstyle="HpHeadline">
2452
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/us/politics/us-aid-pakistan-terror.html">U.S. Gives Military Assistance to Pakistan, With Strings Attached</a> </h2>
2453
- </article>
2454
- </li>
2455
- </ul>
2456
- </div>
2457
- <hr class="single-rule" /><div class="collection">
2458
- <article class="story theme-summary" id="topnews-100000005400786" data-story-id="100000005400786" data-rank="0" data-collection-renderstyle="HpSum" data-start-time="" data-end-time="">
2459
-
2460
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/health/gene-therapy-cancer.html">F.D.A. Approves Gene-Altering Leukemia Treatment</a></h2>
2461
-
2462
- <p class="byline">By DENISE GRADY </p>
2463
-
2464
- <p class="summary">The Food and Drug Administration approved the first treatment that alters a patient’s cells to fight cancer. It will cost $475,000.</p>
2465
-
2466
-
2467
- </article>
2468
- </div>
2469
- <hr class="single-rule" /><div class="collection headlines">
2470
- <h3 class="kicker collection-kicker">More News</h3>
2471
- <ul class="theme-news-headlines">
2472
- <li>
2473
- <article class="story" id="topnews-100000005401772" data-story-id="100000005401772" data-rank="0" data-collection-renderstyle="HpBlogHeadline">
2474
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/31/world/asia/building-collapse-in-mumbai-kills-at-least-7.html">Building Collapse in Mumbai Kills at Least 7</a></h2>
2475
- </article>
2476
- </li>
2477
- <li>
2478
- <article class="story" id="topnews-100000005401309" data-story-id="100000005401309" data-rank="1" data-collection-renderstyle="HpBlogHeadline">
2479
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/sports/tennis/maria-sharapova-timea-babos-us-open.html">U.S. Open: Maria Sharapova, With No Tears, Advances</a></h2>
2480
- </article>
2481
- </li>
2482
- <li>
2483
- <article class="story" id="topnews-100000005399026" data-story-id="100000005399026" data-rank="2" data-collection-renderstyle="HpBlogHeadline">
2484
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/us/politics/eric-schmidt-google-new-america.html">Think Tank Backed by Google Ousts Critic of Monopolies</a></h2>
2485
- </article>
2486
- </li>
2487
- <li>
2488
- <article class="story" id="topnews-100000005401178" data-story-id="100000005401178" data-rank="3" data-collection-renderstyle="HpBlogHeadline">
2489
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/world/americas/brazil-amazon-mining-temer-environmentalists-judge.html">Brazilian Judge Stymies Plan for Mining in Amazon Region</a></h2>
2490
- </article>
2491
- </li>
2492
- <li>
2493
- <article class="story" id="topnews-100000005400012" data-story-id="100000005400012" data-rank="4" data-collection-renderstyle="HpBlogHeadline">
2494
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/world/europe/trump-press-united-nations.html">U.N. Human Rights Chief Condemns Trump’s Attacks on Media</a></h2>
2495
- </article>
2496
- </li>
2497
- <li>
2498
- <article class="story" id="topnews-100000005400793" data-story-id="100000005400793" data-rank="5" data-collection-renderstyle="HpBlogHeadline">
2499
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/world/asia/afghanistan-troop-totals.html">11,000 U.S. Troops in Afghanistan, Pentagon Says</a></h2>
2500
- </article>
2501
- </li>
2502
- </ul>
2503
- </div>
2504
- <hr class="single-rule" /><div class="collection">
2505
- <!--
2506
-
2507
- ======================================================
2508
-
2509
- THIS IS A GENERATED TEMPLATE FILE. DO NOT EDIT.
2510
-
2511
- ======================================================
2512
-
2513
- -->
2514
- <!-- this is generated from src/style.css -->
2515
- <style>.tips-promo {
2516
- position: relative;
2517
- width: 100%;
2518
- height: auto; }
2519
- .tips-promo .nyt-logo {
2520
- position: absolute;
2521
- top: 1rem;
2522
- left: 0;
2523
- right: 0;
2524
- margin: 0 auto;
2525
- width: 6rem; }
2526
- .tips-promo svg {
2527
- width: 6rem;
2528
- margin: 0 auto; }
2529
- .tips-promo .text-bubble {
2530
- padding: 1rem 0; }
2531
- .tips-promo .text-bubble h1 {
2532
- font-family: "nyt-cheltenham", times, serif;
2533
- color: black;
2534
- position: relative;
2535
- font-size: 1.5rem;
2536
- font-weight: 400;
2537
- line-height: 0.9;
2538
- -webkit-font-smoothing: antialiased;
2539
- z-index: 0; }
2540
- .tips-promo .text-bubble h2 {
2541
- font-family: "nyt-cheltenham-sh", times, serif;
2542
- color: black;
2543
- position: relative;
2544
- font-size: 14px;
2545
- font-weight: 400;
2546
- line-height: 1.3;
2547
- -webkit-font-smoothing: antialiased;
2548
- z-index: 0;
2549
- padding-top: 0.5rem; }
2550
- .tips-promo .text-bubble .contact {
2551
- font-family: "nyt-cheltenham-sh", times, serif;
2552
- display: inline-block;
2553
- border-style: none;
2554
- border-color: transparent;
2555
- font-size: 13px;
2556
- font-weight: bold;
2557
- padding: 0;
2558
- background: none;
2559
- color: #326891;
2560
- text-decoration: underline; }
2561
- </style>
2562
-
2563
- <div id="g-graphic" data-preview-slug="2016-10-31-tips-hp">
2564
- <div class="tips-promo">
2565
- <div class="text-bubble">
2566
- <h1><a href="https://www.nytimes.com/tips">Got a confidential news tip?</a></h1>
2567
- <h2>The New York Times offers several ways to get in touch with and provide materials to our journalists. <a href="https://www.nytimes.com/tips"><span class="contact">Learn more</span></a>.</h2>
2568
- </div>
2569
- </div>
2570
- </div>
2571
-
2572
- <script>
2573
- var _gaq = _gaq || [];
2574
- define('_nytg/2016-10-31-tips-hp/assets', function() { return 'https://static01.nyt.com/newsgraphics/2016/10/31/tips-hp/00b5b741a6c5682e24f945c547f78fbe98f2c27f/'; });
2575
- define('_nytg/2016-10-31-tips-hp/big-assets', function() { return 'https://static01.nyt.com/newsgraphics/2016/10/31/tips-hp/assets/'; });
2576
-
2577
- require(['foundation/main'], function() {
2578
- require(['https://static01.nyt.com/newsgraphics/2016/10/31/tips-hp/00b5b741a6c5682e24f945c547f78fbe98f2c27f/build.js']); // generated from src/script.js
2579
- });
2580
- </script>
2581
- <!-- Pipeline: 2016-10-31-tips-hp December 22, 2016, 09:17PM 00b5b741a6c5682e24f945c547f78fbe98f2c27f --></div>
2582
-
2583
- </div><!-- close first-column-region -->
2584
-
2585
- </div><!-- close a-column -->
2586
-
2587
- <div class="b-column column">
2588
-
2589
-
2590
-
2591
- <div class="second-column-region region">
2592
-
2593
- <div class="collection">
2594
- <script>function getFlexData() { return {"data":{"options":{"width":375,"height":380,"jsonp":"https:\/\/static01.nyt.com\/slideshow\/2017\/08\/28\/world\/europe\/tk.slideshow.jsonp","link":"https:\/\/www.nytimes.com\/2017\/08\/30\/world\/europe\/princess-diana-death-anniversary.html"},"photos":{"photo":{"url":"","credit":""}},"advanced":{"delay":3,"limitjsonp":0,"rendition":"largeHorizontal375","targetoverride":"","abbreviatecredits":false}}}; }var NYTD=NYTD || {}; NYTD.FlexTypes = NYTD.FlexTypes || []; NYTD.FlexTypes.push({"target":"FT100000005396180","type":"FadingSlideShow","data":{"options":{"width":375,"height":380,"jsonp":"https:\/\/static01.nyt.com\/slideshow\/2017\/08\/28\/world\/europe\/tk.slideshow.jsonp","link":"https:\/\/www.nytimes.com\/2017\/08\/30\/world\/europe\/princess-diana-death-anniversary.html"},"photos":{"photo":{"url":"","credit":""}},"advanced":{"delay":3,"limitjsonp":0,"rendition":"largeHorizontal375","targetoverride":"","abbreviatecredits":false}}});</script><script src="https://static01.nyt.com/packages/js/multimedia/libs/jquery-1.7.1.min.js"></script><script src="https://static01.nyt.com/packages/js/multimedia/bundles/projects/2013/FadingSlideShow2.js"></script>
2595
- <style type="text/css">
2596
- .edition-domestic .span-ab-layout .nytmm_FadingSlideShow .credit, .edition-international .span-ab-layout .nytmm_FadingSlideShow .credit {
2597
- color: #BAB8B3;
2598
- display: inline-block;
2599
- font-family: arial,helvetica,sans-serif;
2600
- font-size: 0.5625rem !important;
2601
- font-weight: 400;
2602
- line-height: 0.75rem;
2603
- }
2604
- </style><div id="FT100000005396180"></div></div>
2605
- <div class="collection">
2606
- <div style="margin-top: +25px;"></div></div>
2607
- <div class="collection">
2608
- <article class="story theme-feature" id="topnews-100000005401664" data-story-id="100000005401664" data-rank="0" data-collection-renderstyle="LargeMediaHeadlineSumCentered">
2609
-
2610
-
2611
-
2612
- <h1 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/world/europe/princess-diana-death-anniversary.html">Death of Diana Transformed </br> the Monarchy, and Britain Itself</a></h1>
2613
-
2614
- <p class="summary">Twenty years after her death, the influence of Diana, Princess of Wales, can still be felt in unexpected ways in Britain.</p>
2615
-
2616
- <p class="byline">By SARAH LYALL </p>
2617
-
2618
-
2619
- <ul class="refer theme-news-headlines">
2620
- <li>
2621
- <article class="story" id="topnews-100000005401664">
2622
- <h2 class="refer-heading"><a href="https://www.nytimes.com/2017/08/30/world/europe/princess-diana-anniversary.html">Diana’s Public Life, in Photos and Headlines</a> </h2>
2623
- </article>
2624
- </li>
2625
- <li>
2626
- <article class="story" id="topnews-100000005401664">
2627
- <h2 class="refer-heading"><a href="https://www.nytimes.com/2017/08/30/world/europe/uk-princess-diana-20th-anniversary.html">Death of a Princess: Times Journalists Recall Covering Diana</a> </h2>
2628
- </article>
2629
- </li>
2630
- </ul>
2631
- </article>
2632
- </div>
2633
- <hr class="single-rule" /><div class="collection">
2634
- <article class="story theme-summary timedBriefing timedBriefingHide" id="topnews-100000005368865" data-story-id="100000005368865" data-rank="0" data-collection-renderstyle="HpSumMediumMediaHigh" data-start-time="05:00" data-end-time="13:00">
2635
-
2636
- <figure class="media photo medium-thumb">
2637
- <div class="image">
2638
- <a href="https://www.nytimes.com/2017/08/31/briefing/harvey-diana-david-tang.html"><img src="https://static01.nyt.com/images/2017/09/01/world/31USBriefing-Texas/31USBriefing-Texas-mediumFlexible177-v2.gif" alt="" /></a>
2639
- </div>
2640
- </figure>
2641
-
2642
-
2643
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/31/briefing/harvey-diana-david-tang.html">Your Thursday Briefing</a></h2>
2644
-
2645
- <p class="byline">By CHRIS STANFORD <time class="timestamp" datetime="2017-08-31" data-eastern-timestamp="6:34 AM" data-utc-timestamp="1504175651">6:34 AM ET</time></p>
2646
-
2647
- <p class="summary">
2648
- Here’s what you need to know to start your day. </p>
2649
-
2650
-
2651
- <ul class="refer theme-news-headlines">
2652
- <li>
2653
- <article class="story" id="topnews-100000005368865">
2654
- <h2 class="refer-heading"><a href="https://www.nytimes.com/2017/08/31/nyregion/new-york-today-hurricanes-in-nyc-harvey-tropical-storm.html">New York Today: Reflecting on Harvey, in the Northeast</a> <time class="timestamp" data-eastern-timestamp="6:00 AM" datetime="2017-08-31" data-utc-timestamp="1504173618000">6:00 AM</time></h2>
2655
- </article>
2656
- </li>
2657
- </ul>
2658
-
2659
- </article>
2660
- </div>
2661
- <div class="collection">
2662
- <style>
2663
- /*default display conditions*/
2664
- .nythpCAToday {display: none;}
2665
- /*geocoded display conditions*/
2666
- html.geo-region-CA .nythpCAToday {display: block;}
2667
-
2668
- .nythpCAToday article::before {
2669
- content: "";
2670
- background: #e2e2e2;
2671
- width: 187px;
2672
- height: 1px;
2673
- margin: 12px 0 12px 93px;
2674
- }
2675
-
2676
- .second-column-region .collection:first-child .nythpCAToday article::before {
2677
- display: none;
2678
- }
2679
-
2680
- .second-column-region .collection:first-child .nythpCAToday { border-bottom: 1px solid #ccc;
2681
- padding-bottom: 8px;
2682
- }
2683
-
2684
- </style>
2685
-
2686
- <div class="nythpCAToday">
2687
-
2688
-
2689
- </div></div>
2690
- <hr class="single-rule" /><div class="collection">
2691
- <link rel="stylesheet" type="text/css" href="https://web-player.art19.com/releases/0.0.42.css">
2692
- <link rel="stylesheet" type="text/css" href="https://static01.nyt.com/packages/html/mobile/2017/Audio/nyt-micro-player.min.css">
2693
- <script src="https://static01.nyt.com/packages/html/mobile/2017/Audio/nyt-micro-player-template.min.js"></script>
2694
- <style>
2695
- .audio-brief .image {
2696
- width: 75px;
2697
- height: 75px;
2698
- float: right;
2699
- clear: right;
2700
- margin: 4px 0 6px 12px;
2701
- }
2702
- .audio-brief .summary {
2703
- padding-bottom: 10px;
2704
- }
2705
- .audio-brief .audio {
2706
- margin: 0;
2707
- }
2708
- .audio-brief .art19-web-player {
2709
- margin-bottom: 0;
2710
- }
2711
- .audio-brief .art19-web-player.awp-micro .awp-left {
2712
- border-right: none;
2713
- }
2714
- .audio-brief .art19-web-player.awp-micro .awp-brand-logo {
2715
- padding: 0;
2716
- }
2717
- .audio-brief .awp-brand-logo img {
2718
- display: none;
2719
- }
2720
-
2721
- .audio-brief .awp-embed-button{
2722
- cursor: pointer;
2723
- }
2724
- #daily-sub-links{
2725
- width:100%;
2726
- padding:0;
2727
- margin:-10px 0 0 0;
2728
- }
2729
- #daily-sub-links p{
2730
- font-family:"nyt-franklin",arial,helvetica,sans-serif;
2731
- font-weight:400;
2732
- font-size: 12px;
2733
- line-height: 15px;
2734
- color:#000;
2735
- }
2736
- #daily-sub-links p a{
2737
- display:inline-block;
2738
- color: #326891;
2739
- padding-right: 8px;
2740
- padding-left: 6px;
2741
- border-right:1px solid #ccc;
2742
- }
2743
- #daily-sub-links p a:last-child{
2744
- border-right:none;
2745
- }
2746
- </style>
2747
- <article class="story audio-brief theme-summary">
2748
- <div class="image">
2749
- <a href="https://www.nytimes.com/column/the-daily">
2750
- <img src="https://static01.nyt.com/images/2017/02/23/podcasts/the-daily/the-daily-logo-png-version/the-daily-logo-png-version-thumbLarge-v3.png" height="75" width="75" alt="The Daily Logo">
2751
- </a>
2752
- </div>
2753
- <h3 class="kicker"><a href="https://www.nytimes.com/podcasts/">Audio</a></h3>
2754
- <h2 class="story-heading">
2755
- <a href="https://www.nytimes.com/thedaily">
2756
- Listen to ‘The Daily’
2757
- </a>
2758
- </h2>
2759
- <p class="summary">The uniquely American success story of a city built on a swampy bayou, and how Harvey’s destruction recasts the narrative.</p>
2760
- <figure id="audio" class="art19 media audio" aria-label="media" role="group" data-audio-url="" data-audio-duration="">
2761
- <span class="visually-hidden">Audio</span>
2762
- <div data-require-template="art19-web-player/templates/nyt-micro-player" data-preload='false' class="art19-web-player awp-micro awp-theme-light" data-episode-id='1ed84d54-17bf-4d6b-be2f-405f51402cc6' data-squery='max-width:280px=awp-nyt-size-1 max-width:460px=awp-nyt-size-2' data-download-enabled='false' data-embed-enabled='false' data-brand-logo-enabled='false' data-ad-progress-color='#4d7b9f' data-emit-events='true' >
2763
- </div>
2764
- </figure>
2765
- </article>
2766
- <div id="daily-sub-links">
2767
- <p>Follow The Daily: <a href="https://itunes.apple.com/us/podcast/the-daily/id1200361736?mt=2&ign-mpt=uo%3D4" target="_blank">Apple Podcasts</a> <a href="https://play.radiopublic.com/88f7d8c3-7289-4dc6-b300-5ba71b43f5e5" target="_blank">Radio Public</a> <a href="http://www.stitcher.com/podcast/the-new-york-times/the-daily-10" target="_blank">Stitcher</a></p>
2768
- </div>
2769
- <script src="https://web-player.art19.com/releases/0.0.42.js"></script></div>
2770
- <hr class="single-rule" /><div class="collection">
2771
- <div class="hpHeader">
2772
- <h6><a href="http://www.nytimes.com/spotlight/times-tips?contentCollection=smarter-living">Smarter Living</a></h6>
2773
- </div><div class="nythpSmarterLiving smarterLiving-promo-region region">
2774
- <article class="story theme-summary" id="topnews-100000005400342" data-story-id="100000005400342" data-rank="2" data-collection-renderstyle="HpSumSmallMediaHigh">
2775
-
2776
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/31/smarter-living/5-cheap-ish-wellness-items-you-didnt-know-you-needed.html">5 Wellness Items You Didn’t Know You Needed</a></h2>
2777
-
2778
- <div class="thumb">
2779
- <a href="https://www.nytimes.com/2017/08/31/smarter-living/5-cheap-ish-wellness-items-you-didnt-know-you-needed.html"><img src="https://static01.nyt.com/images/2017/08/31/us/31sl-newsletter/31sl-newsletter-thumbStandard.jpg" alt=""></a>
2780
- </div>
2781
-
2782
- <p class="byline">By TIM HERRERA <time class="timestamp" datetime="2017-08-31" data-eastern-timestamp="2:45 AM" data-utc-timestamp="1504161901">2:45 AM ET</time></p>
2783
-
2784
- <p class="summary">
2785
- Welcome to the latest edition of the Smarter Living newsletter. </p>
2786
-
2787
-
2788
- </article>
2789
- <article class="story theme-summary" id="topnews-100000005278952" data-story-id="100000005278952" data-rank="3" data-collection-renderstyle="HpSumSmallMediaHigh">
2790
-
2791
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/07/19/travel/british-airways-flight-safety-videos.html">5 Flight Safety Videos Worth Watching</a></h2>
2792
-
2793
- <div class="thumb">
2794
- <a href="https://www.nytimes.com/2017/07/19/travel/british-airways-flight-safety-videos.html"><img src="https://static01.nyt.com/images/2017/07/18/travel/18flight-videos1/18flight-videos1-thumbStandard.png" alt=""></a>
2795
- </div>
2796
-
2797
- <p class="byline">By JUSTIN SABLICH </p>
2798
-
2799
- <p class="summary">
2800
- A new British Airways video featuring some of the country’s best-known actors and comedians is the latest in a long line of entertaining flight safety films. </p>
2801
-
2802
-
2803
- </article>
2804
- </div>
2805
-
2806
-
2807
- <!-- Begin A/B Personalization Test -->
2808
-
2809
- <style>
2810
- .flag-smarterLivingRec-on .nythpSmarterLiving {
2811
- display: none;
2812
- }
2813
- </style>
2814
- <script type="text/javascript">
2815
- require(['foundation/main'], function (main) {
2816
- require([
2817
- 'underscore/nyt',
2818
- 'jquery/nyt',
2819
- 'foundation/views/base-view'
2820
- ],
2821
- function (_, $, BaseView) {
2822
- var SmarterLiving = BaseView.extend({
2823
-
2824
- template: _.template('<article class="story theme-summary" id="topnews-<%= id %>"' +
2825
- ' data-story-id="<%= id %>" data-collection-renderstyle="HpSumSmallMediaHigh"><h2 class="story-heading">' +
2826
- '<a href="<%= url %>"><%= headline %></a></h2><div class="thumb"><a href="<%= url %>">' +
2827
- '<img src="<%= thumb_url %>" alt=""></a></div></article>'),
2828
-
2829
- events: {
2830
- 'click article a': 'handleArticleLinkClick'
2831
- },
2832
-
2833
- articles: [],
2834
-
2835
- initialize: function () {
2836
- const view = this;
2837
-
2838
- if (!this.pageManager.flag('smarterLivingRec')) {
2839
- return;
2840
- }
2841
-
2842
- this.$el = $('.nythpSmarterLiving');
2843
- this.setupImpressionTracking = _.once(this._setupImpressionTracking);
2844
- $.ajax(
2845
- {
2846
- url: 'https://rec.api.nytimes.com/svc/recommendations/v4/smarter_living.json',
2847
- xhrFields: {
2848
- withCredentials: true
2849
- }
2850
- })
2851
- .done(function(data) {
2852
- view.setupImpressionTracking();
2853
- _.each(data.assets, function(item) {
2854
- view.articles.push(item.url);
2855
- });
2856
- // iterate over the existing articles
2857
- view.$el.find('article').each(function (index) {
2858
- // replace with articles from rec service
2859
- $(this).replaceWith(view.template(data.assets[index]));
2860
- });
2861
- })
2862
- .always(function() {
2863
- // unhide articles
2864
- view.$el.css('display', 'block');
2865
- });
2866
- },
2867
-
2868
- _setupImpressionTracking: function () {
2869
- if (this.pageManager.isComponentVisible(this.$el)) {
2870
- this.recordTrackingImpression();
2871
- } else {
2872
- this.subscribe('nyt:page-scroll', this.handleScroll);
2873
- }
2874
- },
2875
-
2876
- handleArticleLinkClick: function (ev) {
2877
- const view = this;
2878
- const $el = $(ev.currentTarget);
2879
- var href = this.trackingAppendParams($el.attr('href'), {
2880
- 'action': 'click',
2881
- 'pgtype': 'Homepage',
2882
- 'clickSource': 'story-heading',
2883
- 'module': 'smarter-living',
2884
- 'region': 'second-column-region',
2885
- 'contentCollection': 'smarter-living',
2886
- 'mData': $.param({
2887
- articles: view.articles
2888
- }),
2889
- });
2890
-
2891
- $el.attr('href', href);
2892
- },
2893
-
2894
- handleScroll: function () {
2895
- if (this.pageManager.isComponentVisible(this.$el)) {
2896
- this.recordTrackingImpression();
2897
- this.stopSubscribing('nyt:page-scroll');
2898
- }
2899
- },
2900
-
2901
- recordTrackingImpression: function () {
2902
- const view = this;
2903
- this.trackingTriggerImpression('Impression', {
2904
- 'module': 'smarter-living',
2905
- 'pgtype': 'Homepage',
2906
- 'region': 'second-column-region',
2907
- 'action': 'impression',
2908
- 'proxyEventType': 'impression',
2909
- 'timestamp': new Date().getTime(),
2910
- 'mData': {
2911
- articles: view.articles
2912
- },
2913
- });
2914
- },
2915
-
2916
- });
2917
-
2918
- new SmarterLiving();
2919
- });
2920
- });
2921
- </script>
2922
- <div id="g-graphic" class="nythp-smarter-living-formonly-email-promo notification-widget story">
2923
- <hr class="single-rule" style="width: 50%; text-align: center; margin: 12px auto 12px;" />
2924
-
2925
- <p class="theme-summary">Get a weekly roundup of the best advice from The Times on living a better, smarter, more fulfilling life.</p>
2926
- <div id="smarter-living-form-only"></div>
2927
-
2928
- </div>
2929
-
2930
- <script>
2931
- require.config({
2932
- paths: {
2933
- 'nytint/email-subscriber' : 'https://int.nyt.com/applications/email-subscriber/client'
2934
- }
2935
- });
2936
-
2937
- require(['foundation/main'], function() {
2938
- require(['nytint/email-subscriber'], function(Subscriber) {
2939
- Subscriber.setup({
2940
- containerId: 'smarter-living-form-only',
2941
- productCode: 'SL',
2942
- elementToHideOnSubscribe: '.nythp-smarter-living-formonly-email-promo',
2943
- text: {unregisteredButton: 'Sign Up',
2944
- unregisteredPlaceholder: 'Get Smarter Living by email',
2945
- registeredButton: 'Sign Up',
2946
- alreadySubscribedMessage: 'You’re already subscribed.',
2947
- thanksMessage: 'You’ve signed up as %email%',
2948
- emailPreferencesLinkText: 'Update your mail preferences »',
2949
- errorMessage: 'Error submitting, please try again.',
2950
- registeredWelcome: 'Get Smarter Living by email'}
2951
- });
2952
-
2953
- setTimeout(function(){
2954
- var widget = document.getElementById('smarter-living-form-only');
2955
- var container = widget.getElementsByTagName('div')[0];
2956
- var form = widget.getElementsByTagName('form')[0];
2957
- var status = container.getAttribute('data-status');
2958
- var notify = widget.getElementsByClassName('notify-email')[0];
2959
-
2960
- if(notify !== undefined){
2961
-
2962
- var origtext = notify.getAttribute('placeholder');
2963
- var newtext = 'Please enter your email address';
2964
- var button = container.getElementsByTagName('button')[0];
2965
-
2966
- widget.setAttribute('class','clearfix');
2967
-
2968
- notify.addEventListener('mouseover',function(){
2969
- notify.setAttribute('placeholder',newtext);
2970
- });
2971
-
2972
- notify.addEventListener('mouseout',function(){
2973
- notify.setAttribute('placeholder',origtext);
2974
- });
2975
-
2976
- notify.addEventListener('focus',function(){
2977
- notify.setAttribute('placeholder','');
2978
- });
2979
-
2980
- }
2981
-
2982
- if(form !== undefined){
2983
- notify.addEventListener('keyup',function(){
2984
- form.setAttribute('class','dirtyform');
2985
- });
2986
- container.setAttribute('class','not-signedin');
2987
- } else {
2988
- container.setAttribute('class','signedin');
2989
- }
2990
- },2000);
2991
-
2992
- });
2993
- });
2994
- </script></div>
2995
- <div class="collection">
2996
- <style>
2997
- .signup-favor {
2998
- text-align: center;
2999
- color: #326891;
3000
- cursor: pointer;
3001
- padding-top: 15px;
3002
- padding-bottom: 15px;
3003
- }
3004
-
3005
- .signup-favor.top-border {
3006
- margin-top: 8px;
3007
- padding-top: 32px;
3008
- border-top: 1px solid #ccc;
3009
- }
3010
-
3011
- .signup-favor.bottom-border {
3012
- padding-bottom: 33px;
3013
- border-bottom: 1px solid #ccc;
3014
- }
3015
-
3016
- .signup-favor a:hover {
3017
- text-decoration: none;
3018
- }
3019
-
3020
- .signup-favor .tagline {
3021
- display: block;
3022
- font-size: 1.25rem;
3023
- line-height: 1.75rem;
3024
- font-weight: 700;
3025
- font-style: normal;
3026
- font-family: "nyt-cheltenham", georgia, "times new roman", times, serif;
3027
- color: #000;
3028
- }
3029
-
3030
- .signup-favor .subscribe {
3031
- font-size: 12px;
3032
- line-height: 1.0625rem;
3033
- font-weight: 500;
3034
- font-style: normal;
3035
- font-family: "nyt-franklin", arial, helvetica, sans-serif;
3036
- color: #326891;
3037
- border-bottom: 1px solid rgba(50,104,145,.2);
3038
- letter-spacing: .04em;
3039
- margin: 5px auto 0;
3040
- padding-bottom: 1px;
3041
- text-transform: uppercase;
3042
- display: inline-block;
3043
- -moz-transition: border 0.2s ease;
3044
- -webkit-transition: border 0.2s ease;
3045
- -ms-transition: border 0.2s ease;
3046
- transition: border 0.2s ease;
3047
- }
3048
- .signup-favor .tagline .support {
3049
- font-size: 1.25rem;
3050
- }
3051
-
3052
- .signup-favor .tagline .no-break {
3053
- white-space: nowrap;
3054
- }
3055
- .signup-favor:hover .subscribe {
3056
- border-color: rgba(50,104,145,1);
3057
- }
3058
-
3059
- #nythp-sub-promo { display: none; }
3060
-
3061
- </style>
3062
- <div id="g-graphic" class="sub-promo-click">
3063
- <div class="signup-favor hidden" id="signup-favor">
3064
- <a href="https://www.nytimes.com/DesktopHome" class="subscribe-link">
3065
- <span class="tagline"><span class="no-break">Journalism that matters.</span> <br /><span class="no-break">More essential than ever.</span></span>
3066
- <span class="subscribe">Subscribe to the Times</span>
3067
- </a>
3068
-
3069
- </div>
3070
- </div>
3071
-
3072
- <div id="nythp-sub-promo"></div>
3073
-
3074
- <script type="text/javascript">
3075
- require(['foundation/main'], function(main) {
3076
- require(['jquery/nyt', 'underscore/nyt', 'foundation/models/user-data', 'foundation/tracking/tracking-mixin', 'foundation/views/page-manager', 'foundation/hosts'],
3077
- function ($, _, userData, trackingMixin, pageManager, hosts) {
3078
- var signupPromo = {
3079
-
3080
- taglines: {
3081
- 'promo1': '<span style="white-space: nowrap">Journalism that matters.</span><br /><span style="white-space: nowrap"> More essential than ever.</span>',
3082
- 'promo2': '<span style="white-space: nowrap">Independent journalism.</span><br /><span style="white-space: nowrap">More essential than ever.</span>',
3083
- 'promo3': 'Real reporting. Real news.',
3084
- 'promo4': 'Independent. Trusted. Real.',
3085
- 'promo5': 'Real journalism. <span style="white-space: nowrap">Like nowhere else.</span>',
3086
- 'promo6': 'Truth is hard to find.<br /><span style="white-space: nowrap; font-size: 1.25rem;">But easier with 1,000+ journalists looking.</span>'
3087
- },
3088
-
3089
- /**
3090
- * Initialization called when instantiating the view
3091
- *
3092
- * @method initialize
3093
- **/
3094
- initialize: function () {
3095
- this.$el = $('#signup-favor');
3096
- $(document).on('click', "#g-graphic.sub-promo-click", function(e){
3097
- if (e) {
3098
- e.preventDefault();
3099
- }
3100
- signupPromo.handleClick();
3101
- });
3102
-
3103
- this.version = 'promo1';
3104
-
3105
- userData.ready(function() {
3106
- signupPromo.handleUserReady();
3107
- });
3108
-
3109
- this.link = 'https://www.nytimes.com/DesktopHome';
3110
-
3111
- },
3112
-
3113
-
3114
- trackImpression: function() {
3115
-
3116
- setTimeout(function() {
3117
- signupPromo.tracking.trackingTriggerRaw(
3118
- signupPromo.version,
3119
- {
3120
- module: 'election-sub-desktop-home',
3121
- action: 'impression'
3122
- },
3123
- 'impression'
3124
- );
3125
- }, 1000);
3126
-
3127
- },
3128
-
3129
-
3130
-
3131
- handleUserReady: function () {
3132
-
3133
- var view = this;
3134
- console.log("abra "+ window.NYTD.Abra('www-signup-favor-test-v4'));
3135
-
3136
- if (window.NYTD.Abra('www-signup-favor-test-v4') == 'control') {
3137
- return;
3138
- }
3139
-
3140
-
3141
- if (userData) {
3142
-
3143
- if (!userData.isHomeDeliverySubscriber() &&
3144
- !userData.isWebSubscriber() &&
3145
- !userData.isMobileSubscriber() &&
3146
- !userData.isTabletSubscriber()) {
3147
- if (!$('html').hasClass('geo-country-US')) {
3148
- this.link = 'https://www.nytimes.com/DesktopHomeINYT';
3149
- this.$el.find(".subscribe-link").attr("href", "http://www.nytimes.com/DesktopHomeINYT")
3150
- }
3151
- this.switchText();
3152
- } else {
3153
- this.$el.find('.tagline').html('<span class="no-break support">Support the mission of The Times.</span>');
3154
- this.$el.find('.subscribe').html('Sponsor a student subscription today.');
3155
- this.version = 'studentSponsor';
3156
- this.link = 'https://www.nytimes.com/NativeSponsor';
3157
- this.$el.find('.subscribe-link').attr('href', 'https://www.nytimes.com/NativeSponsor');
3158
- }
3159
-
3160
- // if user is not already subscribed, show the element
3161
- this.$el.removeClass('hidden');
3162
- this.trackImpression();
3163
- if (this.$el.closest('.column').hasClass('ab-column')){
3164
- this.$el.addClass('top-border');
3165
- } else if (this.$el.closest('.column').hasClass('b-column')) {
3166
- this.$el.addClass('top-border').addClass('bottom-border');
3167
- }
3168
-
3169
- }
3170
-
3171
- },
3172
-
3173
- switchText: function () {
3174
- var hasAbra = false;
3175
-
3176
- hasAbra = window.NYTD && window.NYTD.Abra && window.NYTD.Abra('www-signup-favor-test-v4');
3177
- // check if this is part of an AB test
3178
- if (hasAbra) {
3179
- switch (window.NYTD.Abra('www-signup-favor-test-v4')) {
3180
- case '1':
3181
- this.$el.find('.tagline').html(this.taglines['promo1']);
3182
- this.version = 'promo1';
3183
- break;
3184
- case '2':
3185
- this.$el.find('.tagline').html(this.taglines['promo2']);
3186
- this.version = 'promo2';
3187
- break;
3188
- case '3':
3189
- this.$el.find('.tagline').html(this.taglines['promo3']);
3190
- this.version = 'promo3';
3191
- break;
3192
- case '4':
3193
- this.$el.find('.tagline').html(this.taglines['promo4']);
3194
- this.version = 'promo4';
3195
- break;
3196
- case '5':
3197
- this.$el.find('.tagline').html(this.taglines['promo5']);
3198
- this.version = 'promo5';
3199
- break;
3200
- case '6':
3201
- this.$el.find('.tagline').html(this.taglines['promo6']);
3202
- this.version = 'promo6';
3203
- break;
3204
- }
3205
- }
3206
- },
3207
-
3208
- handleClick: function (e) {
3209
-
3210
- if (e) {
3211
- e.preventDefault();
3212
- }
3213
-
3214
- this.tracking.trackingTriggerRaw(
3215
- this.version,
3216
- {
3217
- module: 'election-sub-desktop-home',
3218
- action: 'click',
3219
- eventName: 'sign-up'
3220
- },
3221
- 'interaction'
3222
- );
3223
-
3224
- setTimeout(function() {
3225
- window.location.href = signupPromo.link;
3226
- }, 300);
3227
-
3228
- },
3229
- };
3230
-
3231
- signupPromo.tracking = trackingMixin;
3232
- signupPromo.pageManager = pageManager;
3233
- signupPromo.hosts = hosts;
3234
- signupPromo.initialize();
3235
- });
3236
- });
3237
-
3238
- </script></div>
3239
- <div class="collection">
3240
- <article class="story theme-summary" id="topnews-100000005400160" data-story-id="100000005400160" data-rank="0" data-collection-renderstyle="HpSumSmallMediaHigh">
3241
-
3242
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/nyregion/ordering-review-of-statues-puts-de-blasio-in-tricky-spot.html">Ordering Review of Statues Puts de Blasio in Tricky Spot</a></h2>
3243
-
3244
- <div class="thumb">
3245
- <a href="https://www.nytimes.com/2017/08/30/nyregion/ordering-review-of-statues-puts-de-blasio-in-tricky-spot.html"><img src="https://static01.nyt.com/images/2017/08/31/nyregion/31monument1/31monument1-thumbStandard.jpg" alt=""></a>
3246
- </div>
3247
-
3248
- <p class="byline">By WILLIAM NEUMAN </p>
3249
-
3250
- <p class="summary">
3251
- Since Mayor de Blasio called for a review of all possible symbols of hate, he has been peppered with questions about how far it will go. </p>
3252
-
3253
-
3254
- </article>
3255
- </div>
3256
- <hr class="single-rule" /><div class="collection">
3257
- <article class="story theme-summary" id="topnews-100000005399785" data-story-id="100000005399785" data-rank="0" data-collection-renderstyle="HpSumSmallMediaHigh">
3258
-
3259
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/business/david-tang-dead-fashion-retailer.html">David Tang, Fashion Retailer and Raconteur, Dies at 63</a></h2>
3260
-
3261
- <div class="thumb">
3262
- <a href="https://www.nytimes.com/2017/08/30/business/david-tang-dead-fashion-retailer.html"><img src="https://static01.nyt.com/images/2017/08/31/business/31TANG1/31TANG1-thumbStandard-v2.jpg" alt=""></a>
3263
- </div>
3264
-
3265
- <p class="byline">By KEITH BRADSHER and ELIZABETH PATON </p>
3266
-
3267
- <p class="summary">
3268
- A lifelong entrepreneur from a wealthy family, he founded a succession of businesses catering to the affluent but also backed democracy for Hong Kong. </p>
3269
-
3270
-
3271
- </article>
3272
- </div>
3273
- <hr class="single-rule" /><div class="collection">
3274
- <article class="story theme-video theme-video-updated"
3275
- id="topnews-100000005343497"
3276
- data-story-id="100000005343497"
3277
- data-rank="0"
3278
- data-collection-renderstyle="VideoEmbed">
3279
- <figure class="promo media video embedded"
3280
- data-position="secondcolumn"
3281
- data-page="homepage"
3282
- data-videoid="100000005343497"
3283
- data-headline="Forty Years of Voyager"
3284
- data-summary="Long after they have stopped communicating with Earth, the twin Voyager spacecraft will forever drift among the stars."
3285
- data-live="false"
3286
- data-media-action="inline"
3287
- data-autoplay="false"
3288
- data-collection-renderstyle="VideoEmbed">
3289
- <figcaption class="caption">
3290
- <p class="credit credit-right" itemprop="copyrightHolder">
3291
- Video by DENNIS OVERBYE, JONATHAN CORUM and JASON DRAKEFORD </p>
3292
- </figcaption>
3293
- </figure>
3294
- <p class="summary">Long after they have stopped communicating with Earth, the twin Voyager spacecraft will forever drift among the stars.</p>
3295
- </article>
3296
- </div>
3297
- <hr class="single-rule" /><div class="collection">
3298
- <article class="story theme-summary" id="topnews-100000005387970" data-story-id="100000005387970" data-rank="0" data-collection-renderstyle="HpSumSmallMediaHigh">
3299
-
3300
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/31/arts/television/young-sheldon-the-big-bang-theory-spinoff-cbs.html">‘Young Sheldon’ Remakes ‘The Big Bang Theory’ Formula</a></h2>
3301
-
3302
- <div class="thumb">
3303
- <a href="https://www.nytimes.com/2017/08/31/arts/television/young-sheldon-the-big-bang-theory-spinoff-cbs.html"><img src="https://static01.nyt.com/images/2017/09/10/arts/10YOUNGSHELDON1/10YOUNGSHELDON1-thumbStandard.jpg" alt=""></a>
3304
- </div>
3305
-
3306
- <p class="byline">By JOHN KOBLIN <time class="timestamp" datetime="2017-08-31" data-eastern-timestamp="5:00 AM" data-utc-timestamp="1504170026">5:00 AM ET</time></p>
3307
-
3308
- <p class="summary">
3309
- For the CBS prequel, co-creator Chuck Lorre abandoned the format that made him successful by instead using a single camera, voice-over narration and a child actor. </p>
3310
-
3311
-
3312
- </article>
3313
- </div>
3314
- <div class="collection">
3315
- <style>
3316
- /*default display conditions*/
3317
- .nythpNYRegionPromo {display: none;}
3318
- /*geocoded display conditions*/
3319
- html.geo-dma-501 .nythpNYRegionPromo, html.geo-region-NJ .nythpNYRegionPromo {display: block;}
3320
-
3321
- .nythpNYRegionPromo {
3322
- border-top: 1px solid #e2e2e2;
3323
- margin-top: 10px;
3324
- padding-top: 10px;
3325
- }
3326
- </style>
3327
-
3328
-
3329
- <div class="nythpNYRegionPromo nygeo-promo-region region"><div>
3330
-
3331
- <article class="story theme-summary" id="topnews-100000005398183" data-story-id="100000005398183" data-rank="1" data-collection-renderstyle="HpSumSmallMediaHigh">
3332
-
3333
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/nyregion/acs-legal-aid-lawyers-facebook-posts.html">Lawyers Under Scrutiny for Family Court Facebook Posts</a></h2>
3334
-
3335
- <div class="thumb">
3336
- <a href="https://www.nytimes.com/2017/08/30/nyregion/acs-legal-aid-lawyers-facebook-posts.html"><img src="https://static01.nyt.com/images/2017/08/31/nyregion/31acs/31acs-thumbStandard.jpg" alt=""></a>
3337
- </div>
3338
-
3339
- <p class="byline">By NIKITA STEWART </p>
3340
-
3341
- <p class="summary">
3342
- Lawyers who worked for the Legal Aid Society and the city’s child welfare agency are under review for social media posts that mocked people in Family Court in Queens. </p>
3343
-
3344
-
3345
- </article>
3346
- </div></div></div>
3347
- <hr class="single-rule" /><div class="collection">
3348
- <style>
3349
- .nythpGeoMBPromo-AU, .nythpGeoMBPromo-EU, .nythpGeoMBPromo-AS, .nythpGeoCalTodayPromo {
3350
- display: none;
3351
- }
3352
-
3353
- html.geo-continent-AS .nythpGeoMBPromo-AS, html.geo-continent-OC .nythpGeoMBPromo-AU, html.geo-country-AU .nythpGeoMBPromo-AU, html.geo-continent-EU .nythpGeoMBPromo-EU, html.geo-continent-AF .nythpGeoMBPromo-EU, html.geo-continent-NA.geo-region-CA .nythpGeoCalTodayPromo { display: block; }
3354
- html.geo-continent-AS .nythpGeoMBPromo, html.geo-continent-OC .nythpGeoMBPromo, html.geo-country-AU .nythpGeoMBPromo, html.geo-continent-EU .nythpGeoMBPromo, html.geo-continent-AF .nythpGeoMBPromo, html.geo-continent-NA.geo-region-CA .nythpGeoMBPromo { display: none; }
3355
-
3356
- </style>
3357
-
3358
-
3359
-
3360
-
3361
- <article class="story theme-summary nythpGeoMBPromo-AU" id="topnews-100000005085460" data-story-id="100000005085460" data-rank="0" data-collection-renderstyle="HpSumMediumMediaHigh" data-start-time="" data-end-time="">
3362
- <figure class="media photo medium-thumb">
3363
- <div class="image">
3364
- <a href="https://www.nytimes.com/newsletters/morning-briefing-australia"><img src="https://static01.nyt.com/images/2017/05/08/world/asia/australia-briefing-signup01/australia-briefing-signup01-mediumFlexible177.png" alt=""></a>
3365
- </div>
3366
- </figure>
3367
- <h2 class="story-heading"><a href="https://www.nytimes.com/newsletters/morning-briefing-australia">Morning Briefing: Australia Edition</a></h2>
3368
- <p class="summary">The news and stories that matter to readers in Australia. Sign up to get it by email, Monday through Friday. </p>
3369
-
3370
- <div id="g-graphic" class="nythp-morning-briefing-email-promo notification-widget">
3371
- <div id="morning-briefing-widget-au"></div>
3372
- </div>
3373
-
3374
- <script>
3375
- require.config({
3376
- paths: {
3377
- 'nytint/email-subscriber' : 'https://int.nyt.com/applications/email-subscriber/client'
3378
- }
3379
- });
3380
-
3381
- require(['foundation/main'], function() {
3382
- require(['nytint/email-subscriber'], function(Subscriber) {
3383
- Subscriber.setup({
3384
- containerId: 'morning-briefing-widget-au',
3385
- productCode: 'MBAU',
3386
- /* elementToHideOnSubscribe: '.nythp-morning-briefing-email-promo', */
3387
- text: {unregisteredButton: 'Sign Up',
3388
- unregisteredPlaceholder: 'Get the Morning Briefing by email.',
3389
- registeredButton: 'Sign Up',
3390
- alreadySubscribedMessage: 'You’re already subscribed.',
3391
- thanksMessage: 'You’ve signed up as %email%',
3392
- emailPreferencesLinkText: 'Update your mail preferences »',
3393
- errorMessage: 'Error submitting, please try again.',
3394
- registeredWelcome: 'Get the Morning Briefing by email.'}
3395
- });
3396
-
3397
- setTimeout(function(){
3398
- var widget = document.getElementById('morning-briefing-widget-au');
3399
- var container = widget.getElementsByTagName('div')[0];
3400
- var form = widget.getElementsByTagName('form')[0];
3401
- var status = container.getAttribute('data-status');
3402
- var notify = widget.getElementsByClassName('notify-email')[0];
3403
-
3404
- if(notify !== undefined){
3405
-
3406
- var origtext = notify.getAttribute('placeholder');
3407
- var newtext = 'Please enter your email address';
3408
- var button = container.getElementsByTagName('button')[0];
3409
-
3410
- widget.setAttribute('class','clearfix');
3411
-
3412
- notify.addEventListener('mouseover',function(){
3413
- notify.setAttribute('placeholder',newtext);
3414
- });
3415
-
3416
- notify.addEventListener('mouseout',function(){
3417
- notify.setAttribute('placeholder',origtext);
3418
- });
3419
-
3420
- notify.addEventListener('focus',function(){
3421
- notify.setAttribute('placeholder','');
3422
- });
3423
-
3424
- }
3425
-
3426
- if(form !== undefined){
3427
- notify.addEventListener('keyup',function(){
3428
- form.setAttribute('class','dirtyform');
3429
- });
3430
- container.setAttribute('class','not-signedin');
3431
- } else {
3432
- container.setAttribute('class','signedin');
3433
- }
3434
- },2000);
3435
-
3436
- });
3437
- });
3438
- </script>
3439
-
3440
- </article>
3441
-
3442
-
3443
-
3444
-
3445
- <article class="story theme-summary nythpGeoMBPromo-AS" id="topnews-100000005085459" data-story-id="100000005085459" data-rank="1" data-collection-renderstyle="HpSumMediumMediaHigh" data-start-time="" data-end-time="">
3446
- <figure class="media photo medium-thumb">
3447
- <div class="image">
3448
- <a href="https://www.nytimes.com/newsletters/morning-briefing-asia"><img src="https://static01.nyt.com/images/2017/05/26/world/26asiapromo2/26asiapromo2-mediumFlexible177.jpg" alt=""></a>
3449
- </div>
3450
- </figure>
3451
- <h2 class="story-heading"><a href="https://www.nytimes.com/newsletters/morning-briefing-asia">Morning Briefing: Asia Edition</a></h2>
3452
- <p class="summary">The news and stories that matter to readers in Asia. Sign up to get it by email, Monday through Friday. </p>
3453
-
3454
- <div id="g-graphic" class="nythp-morning-briefing-email-promo notification-widget">
3455
- <div id="morning-briefing-widget-as"></div>
3456
- </div>
3457
-
3458
- <script>
3459
- require.config({
3460
- paths: {
3461
- 'nytint/email-subscriber' : 'https://int.nyt.com/applications/email-subscriber/client'
3462
- }
3463
- });
3464
-
3465
- require(['foundation/main'], function() {
3466
- require(['nytint/email-subscriber'], function(Subscriber) {
3467
- Subscriber.setup({
3468
- containerId: 'morning-briefing-widget-as',
3469
- productCode: 'MBAE',
3470
- /* elementToHideOnSubscribe: '.nythp-morning-briefing-email-promo', */
3471
- text: {unregisteredButton: 'Sign Up',
3472
- unregisteredPlaceholder: 'Get the Morning Briefing by email.',
3473
- registeredButton: 'Sign Up',
3474
- alreadySubscribedMessage: 'You’re already subscribed.',
3475
- thanksMessage: 'You’ve signed up as %email%',
3476
- emailPreferencesLinkText: 'Update your mail preferences »',
3477
- errorMessage: 'Error submitting, please try again.',
3478
- registeredWelcome: 'Get the Morning Briefing by email.'}
3479
- });
3480
-
3481
- setTimeout(function(){
3482
- var widget = document.getElementById('morning-briefing-widget-as');
3483
- var container = widget.getElementsByTagName('div')[0];
3484
- var form = widget.getElementsByTagName('form')[0];
3485
- var status = container.getAttribute('data-status');
3486
- var notify = widget.getElementsByClassName('notify-email')[0];
3487
-
3488
- if(notify !== undefined){
3489
-
3490
- var origtext = notify.getAttribute('placeholder');
3491
- var newtext = 'Please enter your email address';
3492
- var button = container.getElementsByTagName('button')[0];
3493
-
3494
- widget.setAttribute('class','clearfix');
3495
-
3496
- notify.addEventListener('mouseover',function(){
3497
- notify.setAttribute('placeholder',newtext);
3498
- });
3499
-
3500
- notify.addEventListener('mouseout',function(){
3501
- notify.setAttribute('placeholder',origtext);
3502
- });
3503
-
3504
- notify.addEventListener('focus',function(){
3505
- notify.setAttribute('placeholder','');
3506
- });
3507
-
3508
- }
3509
-
3510
- if(form !== undefined){
3511
- notify.addEventListener('keyup',function(){
3512
- form.setAttribute('class','dirtyform');
3513
- });
3514
- container.setAttribute('class','not-signedin');
3515
- } else {
3516
- container.setAttribute('class','signedin');
3517
- }
3518
- },2000);
3519
-
3520
- });
3521
- });
3522
- </script>
3523
-
3524
-
3525
- </article>
3526
-
3527
-
3528
-
3529
-
3530
-
3531
- <article class="story theme-summary nythpGeoMBPromo-EU" id="topnews-100000004906098" data-story-id="100000004906098" data-rank="2" data-collection-renderstyle="HpSumMediumMediaHigh" data-start-time="" data-end-time="">
3532
- <figure class="media photo medium-thumb">
3533
- <div class="image">
3534
- <a href="https://www.nytimes.com/newsletters/morning-briefing-europe"><img src="https://static01.nyt.com/images/2017/05/26/world/26europeanpromo2/26europeanpromo2-mediumFlexible177.jpg" alt=""></a>
3535
- </div>
3536
- </figure>
3537
- <h2 class="story-heading"><a href="https://www.nytimes.com/newsletters/morning-briefing-europe">Morning Briefing: Europe Edition</a></h2>
3538
- <p class="summary">The news and stories that matter to readers in Europe. Sign up to get it by email, Monday through Friday. </p>
3539
- <div id="g-graphic" class="nythp-morning-briefing-email-promo notification-widget">
3540
- <div id="morning-briefing-widget-eu"></div>
3541
- </div>
3542
-
3543
- <script>
3544
- require.config({
3545
- paths: {
3546
- 'nytint/email-subscriber' : 'https://int.nyt.com/applications/email-subscriber/client'
3547
- }
3548
- });
3549
-
3550
- require(['foundation/main'], function() {
3551
- require(['nytint/email-subscriber'], function(Subscriber) {
3552
- Subscriber.setup({
3553
- containerId: 'morning-briefing-widget-eu',
3554
- productCode: 'MBE',
3555
- /* elementToHideOnSubscribe: '.nythp-morning-briefing-email-promo', */
3556
- text: {unregisteredButton: 'Sign Up',
3557
- unregisteredPlaceholder: 'Get the Morning Briefing by email.',
3558
- registeredButton: 'Sign Up',
3559
- alreadySubscribedMessage: 'You’re already subscribed.',
3560
- thanksMessage: 'You’ve signed up as %email%',
3561
- emailPreferencesLinkText: 'Update your mail preferences »',
3562
- errorMessage: 'Error submitting, please try again.',
3563
- registeredWelcome: 'Get the Morning Briefing by email.'}
3564
- });
3565
-
3566
- setTimeout(function(){
3567
- var widget = document.getElementById('morning-briefing-widget-eu');
3568
- var container = widget.getElementsByTagName('div')[0];
3569
- var form = widget.getElementsByTagName('form')[0];
3570
- var status = container.getAttribute('data-status');
3571
- var notify = widget.getElementsByClassName('notify-email')[0];
3572
-
3573
- if(notify !== undefined){
3574
-
3575
- var origtext = notify.getAttribute('placeholder');
3576
- var newtext = 'Please enter your email address';
3577
- var button = container.getElementsByTagName('button')[0];
3578
-
3579
- widget.setAttribute('class','clearfix');
3580
-
3581
- notify.addEventListener('mouseover',function(){
3582
- notify.setAttribute('placeholder',newtext);
3583
- });
3584
-
3585
- notify.addEventListener('mouseout',function(){
3586
- notify.setAttribute('placeholder',origtext);
3587
- });
3588
-
3589
- notify.addEventListener('focus',function(){
3590
- notify.setAttribute('placeholder','');
3591
- });
3592
-
3593
- }
3594
-
3595
- if(form !== undefined){
3596
- notify.addEventListener('keyup',function(){
3597
- form.setAttribute('class','dirtyform');
3598
- });
3599
- container.setAttribute('class','not-signedin');
3600
- } else {
3601
- container.setAttribute('class','signedin');
3602
- }
3603
- },2000);
3604
-
3605
- });
3606
- });
3607
- </script>
3608
-
3609
- </article>
3610
-
3611
-
3612
- <!-- California Today -->
3613
-
3614
- <article class="story theme-summary nythpGeoCalTodayPromo" data-rank="2" data-collection-renderstyle="HpSumMediumMediaHigh" data-start-time="" data-end-time="">
3615
- <figure class="media photo medium-thumb">
3616
- <div class="image">
3617
- <a href="http://www.nytimes.com/newsletters/california-today"><img src="https://static01.nyt.com/packages/images/email/assets/california_news.jpg" alt=""></a>
3618
- </div>
3619
- </figure>
3620
- <h2 class="story-heading"><a href="http://www.nytimes.com/newsletters/california-today">California Today</a></h2>
3621
- <p class="summary">The news and stories that matter to Californians, delivered weekday mornings.</p>
3622
-
3623
-
3624
- <div id="g-graphic" class="nythp-morning-briefing-email-promo notification-widget">
3625
- <div id="california-today-widget"></div>
3626
- </div>
3627
-
3628
- <script>
3629
- require.config({
3630
- paths: {
3631
- 'nytint/email-subscriber' : 'https://int.nyt.com/applications/email-subscriber/client'
3632
- }
3633
- });
3634
-
3635
- require(['foundation/main'], function() {
3636
- require(['nytint/email-subscriber'], function(Subscriber) {
3637
- Subscriber.setup({
3638
- containerId: 'california-today-widget',
3639
- productCode: 'CA',
3640
- /* elementToHideOnSubscribe: '.nythp-morning-briefing-email-promo', */
3641
- text: {unregisteredButton: 'Sign Up',
3642
- unregisteredPlaceholder: 'Get California Today by email.',
3643
- registeredButton: 'Sign Up',
3644
- alreadySubscribedMessage: 'You’re already subscribed.',
3645
- thanksMessage: 'You’ve signed up as %email%',
3646
- emailPreferencesLinkText: 'Update your mail preferences »',
3647
- errorMessage: 'Error submitting, please try again.',
3648
- registeredWelcome: 'Get California Today by email.'}
3649
- });
3650
-
3651
- setTimeout(function(){
3652
- var widget = document.getElementById('california-today-widget');
3653
- var container = widget.getElementsByTagName('div')[0];
3654
- var form = widget.getElementsByTagName('form')[0];
3655
- var status = container.getAttribute('data-status');
3656
- var notify = widget.getElementsByClassName('notify-email')[0];
3657
-
3658
- if(notify !== undefined){
3659
-
3660
- var origtext = notify.getAttribute('placeholder');
3661
- var newtext = 'Please enter your email address';
3662
- var button = container.getElementsByTagName('button')[0];
3663
-
3664
- widget.setAttribute('class','clearfix');
3665
-
3666
- notify.addEventListener('mouseover',function(){
3667
- notify.setAttribute('placeholder',newtext);
3668
- });
3669
-
3670
- notify.addEventListener('mouseout',function(){
3671
- notify.setAttribute('placeholder',origtext);
3672
- });
3673
-
3674
- notify.addEventListener('focus',function(){
3675
- notify.setAttribute('placeholder','');
3676
- });
3677
-
3678
- }
3679
-
3680
- if(form !== undefined){
3681
- notify.addEventListener('keyup',function(){
3682
- form.setAttribute('class','dirtyform');
3683
- });
3684
- container.setAttribute('class','not-signedin');
3685
- } else {
3686
- container.setAttribute('class','signedin');
3687
- }
3688
- },2000);
3689
-
3690
- });
3691
- });
3692
- </script>
3693
- </article>
3694
-
3695
- <article class="story theme-summary nythpGeoMBPromo" id="topnews-100000004906098" data-story-id="100000004906098" data-rank="2" data-collection-renderstyle="HpSumMediumMediaHigh" data-start-time="" data-end-time="">
3696
- <figure class="media photo medium-thumb">
3697
- <div class="image">
3698
- <a href="https://www.nytimes.com/newsletters/morning-briefing"><img src="https://static01.nyt.com/images/2017/05/25/us/25usbriefing/25usbriefing-mediumFlexible177-v2.jpg" alt=""></a>
3699
- </div>
3700
- </figure>
3701
- <h2 class="story-heading"><a href="https://www.nytimes.com/newsletters/morning-briefing">Morning Briefing</a></h2>
3702
- <p class="summary">The news and stories that matter. Delivered to your inbox Monday through Friday.</p>
3703
-
3704
-
3705
- <div id="g-graphic" class="nythp-morning-briefing-email-promo notification-widget">
3706
- <div id="morning-briefing-widget"></div>
3707
- </div>
3708
-
3709
- <script>
3710
- require.config({
3711
- paths: {
3712
- 'nytint/email-subscriber' : 'https://int.nyt.com/applications/email-subscriber/client'
3713
- }
3714
- });
3715
-
3716
- require(['foundation/main'], function() {
3717
- require(['nytint/email-subscriber'], function(Subscriber) {
3718
- Subscriber.setup({
3719
- containerId: 'morning-briefing-widget',
3720
- productCode: 'NN',
3721
- /* elementToHideOnSubscribe: '.nythp-morning-briefing-email-promo', */
3722
- text: {unregisteredButton: 'Sign Up',
3723
- unregisteredPlaceholder: 'Get the Morning Briefing by email.',
3724
- registeredButton: 'Sign Up',
3725
- alreadySubscribedMessage: 'You’re already subscribed.',
3726
- thanksMessage: 'You’ve signed up as %email%',
3727
- emailPreferencesLinkText: 'Update your mail preferences »',
3728
- errorMessage: 'Error submitting, please try again.',
3729
- registeredWelcome: 'Get the Morning Briefing by email.'}
3730
- });
3731
-
3732
- setTimeout(function(){
3733
- var widget = document.getElementById('morning-briefing-widget');
3734
- var container = widget.getElementsByTagName('div')[0];
3735
- var form = widget.getElementsByTagName('form')[0];
3736
- var status = container.getAttribute('data-status');
3737
- var notify = widget.getElementsByClassName('notify-email')[0];
3738
-
3739
- if(notify !== undefined){
3740
-
3741
- var origtext = notify.getAttribute('placeholder');
3742
- var newtext = 'Please enter your email address';
3743
- var button = container.getElementsByTagName('button')[0];
3744
-
3745
- widget.setAttribute('class','clearfix');
3746
-
3747
- notify.addEventListener('mouseover',function(){
3748
- notify.setAttribute('placeholder',newtext);
3749
- });
3750
-
3751
- notify.addEventListener('mouseout',function(){
3752
- notify.setAttribute('placeholder',origtext);
3753
- });
3754
-
3755
- notify.addEventListener('focus',function(){
3756
- notify.setAttribute('placeholder','');
3757
- });
3758
-
3759
- }
3760
-
3761
- if(form !== undefined){
3762
- notify.addEventListener('keyup',function(){
3763
- form.setAttribute('class','dirtyform');
3764
- });
3765
- container.setAttribute('class','not-signedin');
3766
- } else {
3767
- container.setAttribute('class','signedin');
3768
- }
3769
- },2000);
3770
-
3771
- });
3772
- });
3773
- </script>
3774
- </article>
3775
-
3776
- </div>
3777
-
3778
- </div><!-- close second-column-region -->
3779
-
3780
-
3781
- </div><!-- close b-column -->
3782
-
3783
- </div><!-- close wide-b-layout -->
3784
-
3785
- <div class="bottom-span-promo-region region">
3786
- <div class="collection">
3787
- <style>
3788
- /*default display conditions*/
3789
- #span-ab-bottom-au-region {
3790
- /*display: none;*/
3791
- display: block;
3792
- position: absolute;
3793
- visibility: hidden;
3794
- }
3795
- #span-ab-bottom-region .column.column-au-region {
3796
- /*display: none;*/
3797
- display: block;
3798
- position: absolute;
3799
- visibility: hidden;
3800
- }
3801
- /*geocoded display conditions*/
3802
- html.geo-country-AU #span-ab-bottom-region .column {display: none;}
3803
- html.geo-country-AU #span-ab-bottom-region .column.column-au-region {
3804
- display: block;
3805
- position: inherit;
3806
- visibility: visible;
3807
- }
3808
-
3809
- .span-ab-layout .ab-column .split-3-layout .column:nth-of-type(1),
3810
- .span-ab-layout .ab-column .split-3-layout .column:nth-of-type(4) {
3811
- padding-left: 0;
3812
- }
3813
-
3814
- .span-ab-layout .ab-column .split-3-layout .column:last-child,
3815
- .span-ab-layout .ab-column .split-3-layout .column:nth-of-type(3),
3816
- .span-ab-layout .ab-column .split-3-layout .column:nth-of-type(6) {
3817
- border-right: none;
3818
- padding-right: 0px;
3819
- }
3820
-
3821
- #span-ab-bottom-region .section-heading-au-region { display: none; }
3822
- html.geo-country-AU #span-ab-bottom-region .section-heading { display: none; }
3823
- html.geo-country-AU #span-ab-bottom-region .section-heading-au-region {
3824
- display: block;
3825
- text-align: center;
3826
- }
3827
- html.geo-country-AU #span-ab-bottom-region .section-heading-au-region h2.section-heading {
3828
- display: inline-block;
3829
- color: #000;
3830
- font-family: "nyt-franklin",helvetica,arial,sans-serif;
3831
- text-transform: uppercase;
3832
- font-size: 12px;
3833
- font-weight: 700;
3834
- letter-spacing: .5px;
3835
- border-bottom: 2px solid #ccc;
3836
- line-height: 15px;
3837
- }
3838
- html.geo-country-AU #span-ab-bottom-region .section-heading-au-region h2.section-heading:hover,
3839
- html.geo-country-AU #span-ab-bottom-region .section-heading-au-region h2.section-heading:active {
3840
- border-color: #222222;
3841
- }
3842
-
3843
- html.geo-country-AU #span-ab-bottom-region .section-heading a {
3844
- text-decoration: none;
3845
- color: #000;
3846
- }
3847
- </style>
3848
-
3849
- <script>
3850
- require(['foundation/main'], function() {
3851
- require(['jquery/nyt', 'underscore/nyt'], function($, _) {
3852
- $("#span-ab-bottom-region div.split-3-layout").append($("#span-ab-bottom-au-region div.split-3-layout > div.column").addClass("column-au-region").remove());
3853
- $("#span-ab-bottom-region div.split-3-layout").prepend($('<span class="section-heading-au-region"><h2 class="section-heading"><a href="https://www.nytimes.com/section/world/australia">Australia Picks</a></h2></span>'));
3854
- var auHeight = _.max($("#span-ab-bottom-region div.split-3-layout .column.column-au-region article").map(function(i, el) { return $(el).height(); }));
3855
- $("#span-ab-bottom-region div.split-3-layout .column.column-au-region").css({"min-height": (auHeight+6)+"px"});
3856
- }) })
3857
- </script>
3858
-
3859
-
3860
- <div id="span-ab-bottom-au-region" class="span-ab-bottom-region-au region"><div>
3861
- <hr class="scotch-rule">
3862
- <div class="split-3-layout layout theme-base"><div>
3863
-
3864
- </div>
3865
- <h2 class="section-heading">
3866
- </h2>
3867
- <div class="column">
3868
- <article class="story theme-summary " id="topnews-100000005399553" data-story-id="100000005399553" data-rank="0" data-collection-renderstyle="HPMediumMediaHedSumDaypart">
3869
- <a href="https://www.nytimes.com/2017/08/30/world/australia/australia-same-sex-marriage-tv-ad.html">
3870
- <div class="wide-thumb">
3871
- <img src="https://static01.nyt.com/images/2017/08/31/world/australia/31oz-marriage/31oz-marriage-mediumThreeByTwo210.jpg" />
3872
- </div>
3873
- </a>
3874
- <h2 class="story-heading">
3875
- <a href="https://www.nytimes.com/2017/08/30/world/australia/australia-same-sex-marriage-tv-ad.html">What’s Going On in an Australian TV Ad Opposing Gay Marriage?</a>
3876
- </h2>
3877
- <p class="summary">
3878
- The campaign to vote “no” on legalizing same-sex marriage tries to refocus the debate on the welfare of children. </p>
3879
- </article>
3880
- </div>
3881
- <div class="column">
3882
- <article class="story theme-summary " id="topnews-100000005397818" data-story-id="100000005397818" data-rank="1" data-collection-renderstyle="HPMediumMediaHedSumDaypart">
3883
- <a href="https://www.nytimes.com/2017/08/29/world/asia/sea-shepherd-whaling-japan.html">
3884
- <div class="wide-thumb">
3885
- <img src="https://static01.nyt.com/images/2017/08/30/world/29seashepherd/29seashepherd-mediumThreeByTwo210.jpg" />
3886
- </div>
3887
- </a>
3888
- <h2 class="story-heading">
3889
- <a href="https://www.nytimes.com/2017/08/29/world/asia/sea-shepherd-whaling-japan.html">Sea Shepherd Activists Halt Pursuit of Japanese Whalers</a>
3890
- </h2>
3891
- <p class="summary">
3892
- The group has called off its annual pursuit of Japanese ships in the protected Southern Ocean, saying it can’t compete with the country’s surveillance. </p>
3893
- </article>
3894
- </div>
3895
- <div class="column">
3896
- <article class="story theme-summary " id="topnews-100000005396021" data-story-id="100000005396021" data-rank="2" data-collection-renderstyle="HPMediumMediaHedSumDaypart">
3897
- <a href="https://www.nytimes.com/2017/08/29/science/trigonometry-babylonian-tablet.html">
3898
- <div class="wide-thumb">
3899
- <img src="https://static01.nyt.com/images/2017/08/29/science/29TB-BABYLON1/29TB-BABYLON1-mediumThreeByTwo210.jpg" />
3900
- </div>
3901
- </a>
3902
- <h2 class="story-heading">
3903
- <a href="https://www.nytimes.com/2017/08/29/science/trigonometry-babylonian-tablet.html">Hints of Trigonometry on a 3,700-Year-Old Babylonian Tablet</a>
3904
- </h2>
3905
- <p class="summary">
3906
- Scholars have debated for decades the purpose of 60 numbers written on a small clay tablet. Two Australian mathematicians believe they have figured it out. </p>
3907
- </article>
3908
- </div>
3909
- <div class="collection">
3910
- </div></div></div></div></div>
3911
- </div><!-- close bottom-span-promo-region -->
3912
-
3913
- <div id="span-ab-bottom-region" class="span-ab-bottom-region region">
3914
- <hr class="scotch-rule" />
3915
- <div class="split-3-layout layout theme-base">
3916
- <h2 class="section-heading">
3917
- </h2>
3918
- <div class="column">
3919
- <article class="story theme-summary " id="topnews-100000005395156" data-story-id="100000005395156" data-rank="0" data-collection-renderstyle="HPMediumMediaHedSumDaypart">
3920
- <a href="https://www.nytimes.com/2017/08/30/sports/olympics/munich-olympic-massacre-1972-memorial-israeli-athletes.html">
3921
- <div class="wide-thumb">
3922
- <img src="https://static01.nyt.com/images/2017/08/30/multimedia/30MUNIC-alpha/30MUNICweb2-mediumThreeByTwo210.jpg" />
3923
- </div>
3924
- </a>
3925
- <h2 class="story-heading">
3926
- <a href="https://www.nytimes.com/2017/08/30/sports/olympics/munich-olympic-massacre-1972-memorial-israeli-athletes.html">In Munich, a Tribute to Israeli Athletes</a>
3927
- </h2>
3928
- <p class="summary">
3929
- “There are no happier people, no more satisfied people, than us,” said the wife of a victim who pressed for a worthy memorial. </p>
3930
- </article>
3931
- </div>
3932
- <div class="column">
3933
- <article class="story theme-summary " id="topnews-100000005399019" data-story-id="100000005399019" data-rank="1" data-collection-renderstyle="HPMediumMediaHedSumDaypart">
3934
- <a href="https://www.nytimes.com/interactive/2017/08/31/travel/what-to-do-36-hours-in-glasgow-scotland.html">
3935
- <div class="wide-thumb">
3936
- <img src="https://static01.nyt.com/images/2017/08/31/travel/31HOURS-GLASGOW1/31HOURS-GLASGOW1-mediumThreeByTwo210.jpg" />
3937
- <div class="media-action-overlay">
3938
- <i class="icon sprite-icon icon-media-interactive-16x16-ffffff"></i>
3939
- </div>
3940
- </div>
3941
- </a>
3942
- <h2 class="story-heading">
3943
- <a href="https://www.nytimes.com/interactive/2017/08/31/travel/what-to-do-36-hours-in-glasgow-scotland.html">36 Hours in Glasgow</a>
3944
- </h2>
3945
- <p class="summary">
3946
- This historic city, known for its Art Nouveau flourishes, also has a blossoming modern side, with daring new buildings and bars. </p>
3947
- </article>
3948
- </div>
3949
- <div class="column">
3950
- <article class="story theme-summary " id="topnews-100000005367249" data-story-id="100000005367249" data-rank="2" data-collection-renderstyle="HPMediumMediaHedSumDaypart">
3951
- <a href="https://www.nytimes.com/2017/08/31/books/review/jesmyn-ward-by-the-book.html">
3952
- <div class="wide-thumb">
3953
- <img src="https://static01.nyt.com/images/2017/09/03/books/review/0903-BKS-ByTheBook/0903-BKS-ByTheBook-mediumThreeByTwo210-v3.jpg" />
3954
- </div>
3955
- </a>
3956
- <h2 class="story-heading">
3957
- <a href="https://www.nytimes.com/2017/08/31/books/review/jesmyn-ward-by-the-book.html">Jesmyn Ward: By the Book</a>
3958
- </h2>
3959
- <p class="summary">
3960
- The author of, most recently, “Sing, Unburied, Sing” is a self-described “reading glutton.” </p>
3961
- </article>
3962
- </div>
3963
- </div>
3964
- </div><!-- close span-ab-bottom-region -->
3965
-
3966
- </section><!-- close top-news -->
3967
-
3968
- </div><!-- close ab-column -->
3969
-
3970
- <div class="c-column column">
3971
-
3972
- <div id="Middle" class="ad middle-ad hidden nocontent robots-nocontent"></div>
3973
-
3974
- <div class="region c-column-top-span-region">
3975
-
3976
-
3977
- </div><!-- close c-column-top-span-region -->
3978
-
3979
- <section class="opinion">
3980
-
3981
- <div class="region opinion-c-col-top-region">
3982
- <div class="collection">
3983
- <section class="opinion">
3984
- <h2 class="section-heading"><a href="http://www.nytimes.com/pages/opinion/index.html">The Opinion Pages</a>
3985
- </h2>
3986
- </section></div>
3987
- </div> <!-- close opinion-c-col-top-region -->
3988
-
3989
- <div class="layout split-layout">
3990
-
3991
- <div class="column">
3992
- <div class="region opinion-c-col-left-region">
3993
- <div class="collection">
3994
- <article class="story theme-summary" id="topnews-100000005396602" data-story-id="100000005396602" data-rank="0" data-collection-renderstyle="HpSumXSMedia">
3995
-
3996
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/31/opinion/trump-north-korea.html">What Trump Meant to Say</a></h2>
3997
-
3998
- <div class="small-thumb">
3999
- <a href="https://www.nytimes.com/2017/08/31/opinion/trump-north-korea.html"><img src="https://static01.nyt.com/images/2017/09/01/world/01blinken-inyt/01blinken-inyt-blogSmallThumb.jpg" alt=""></a>
4000
- </div>
4001
-
4002
- <p class="byline">By ANTONY J. BLINKEN </p>
4003
-
4004
- <p class="summary">
4005
- The president’s rogue-cop routine has serious foreign policy consequences. </p>
4006
-
4007
-
4008
- </article>
4009
-
4010
- </div>
4011
- <div class="collection headlines">
4012
- <ul class="theme-news-headlines">
4013
- <li>
4014
- <article class="story" id="topnews-100000005400536" data-story-id="100000005400536" data-rank="0" data-collection-renderstyle="HpHeadline">
4015
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/31/opinion/voting-reform-illinois-texas.html">Editorial: On Voting Reforms, Follow Illinois, Not Texas</a> </h2>
4016
- </article>
4017
- </li>
4018
- <li>
4019
- <article class="story" id="topnews-100000005401080" data-story-id="100000005401080" data-rank="1" data-collection-renderstyle="HpHeadline">
4020
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/31/opinion/trump-harvey-storm-army.html">Blow: Trump Raises an Army</a> <time class="timestamp" datetime="2017-08-31" data-eastern-timestamp="3:21 AM" data-utc-timestamp="1504164084">3:21 AM ET</time></h2>
4021
- </article>
4022
- </li>
4023
- <li>
4024
- <article class="story" id="topnews-100000005401128" data-story-id="100000005401128" data-rank="2" data-collection-renderstyle="HpHeadline">
4025
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/interactive/2017/08/31/opinion/columnists/yemen-famine-cholera.html">Kristof: The Photos the U.S. and Saudi Arabia Don’t Want You to See</a> </h2>
4026
- </article>
4027
- </li>
4028
- <li>
4029
- <article class="story" id="topnews-100000005400586" data-story-id="100000005400586" data-rank="3" data-collection-renderstyle="HpHeadline">
4030
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/31/opinion/hurricanes-climate-capitalists-wealth-.html">Stephens: Hurricanes, Climate and the Capitalist Offset</a> <time class="timestamp" datetime="2017-08-31" data-eastern-timestamp="3:21 AM" data-utc-timestamp="1504164083">3:21 AM ET</time></h2>
4031
- </article>
4032
- </li>
4033
- </ul>
4034
- </div>
4035
- <div class="collection headlines">
4036
- <ul class="theme-news-headlines">
4037
- <li>
4038
- <article class="story" id="topnews-100000003665755" data-story-id="100000003665755" data-rank="0" data-collection-renderstyle="HpHeadline">
4039
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.facebook.com/nytopinion">Join us on Facebook »</a> </h2>
4040
- </article>
4041
- </li>
4042
- </ul>
4043
- </div>
4044
- </div>
4045
- </div>
4046
-
4047
- <div class="column">
4048
- <div class="region opinion-c-col-right-region">
4049
- <div class="collection">
4050
- <article class="story theme-summary" id="topnews-100000005398365" data-story-id="100000005398365" data-rank="0" data-collection-renderstyle="HpSumXSMedia">
4051
-
4052
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/31/opinion/america-nuclear-buildup.html">Risky Nuclear Buildup</a></h2>
4053
-
4054
- <div class="small-thumb">
4055
- <a href="https://www.nytimes.com/2017/08/31/opinion/america-nuclear-buildup.html"><img src="https://static01.nyt.com/images/2017/08/31/opinion/31rollo/31rollo-blogSmallThumb.jpg" alt=""></a>
4056
- </div>
4057
-
4058
- <p class="byline">By STUART ROLLO <time class="timestamp" datetime="2017-08-31" data-eastern-timestamp="3:21 AM" data-utc-timestamp="1504164083">3:21 AM ET</time></p>
4059
-
4060
- <p class="summary">
4061
- It’s not just North Korea. Plans to upgrade America’s nuclear arsenal are also contributing to global instability. </p>
4062
-
4063
-
4064
- </article>
4065
-
4066
- </div>
4067
- <div class="collection headlines">
4068
- <ul class="theme-news-headlines">
4069
- <li>
4070
- <article class="story" id="topnews-100000005399880" data-story-id="100000005399880" data-rank="0" data-collection-renderstyle="HpHeadline">
4071
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/opinion/texas-farmers-floods-planning.html">A Texas Farmer on Harvey, Bad Planning and Runaway Growth</a> </h2>
4072
- </article>
4073
- </li>
4074
- <li>
4075
- <article class="story" id="topnews-100000005400373" data-story-id="100000005400373" data-rank="1" data-collection-renderstyle="HpHeadline">
4076
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/opinion/google-influence-think-tanks.html">Google’s Disturbing Influence Over Think Tanks</a> </h2>
4077
- </article>
4078
- </li>
4079
- <li>
4080
- <article class="story" id="topnews-100000005400487" data-story-id="100000005400487" data-rank="2" data-collection-renderstyle="HpHeadline">
4081
- <h2 class="story-heading"><i class="icon"></i><a href="https://www.nytimes.com/2017/08/30/opinion/trump-osteen-harvey-church.html">The Cheap Prosperity Gospel of Trump and Osteen</a> </h2>
4082
- </article>
4083
- </li>
4084
- </ul>
4085
- </div>
4086
- </div>
4087
- </div>
4088
-
4089
- </div> <!-- close split-layout -->
4090
-
4091
- <div class="region opinion-c-col-bottom-region">
4092
- <div class="collection">
4093
- <style>
4094
-
4095
-
4096
- .c-column.column section.opinion div time.timestamp{
4097
- display:none;
4098
- }
4099
-
4100
-
4101
- </style><style>
4102
- .c-column.column section.opinion div p.theme-comments{
4103
- display:none;
4104
- }
4105
-
4106
-
4107
-
4108
- </style></div>
4109
- </div> <!-- close opinion-c-col-bottom-region -->
4110
-
4111
- </section> <!-- close opinion -->
4112
-
4113
- <section class="user-subscriptions">
4114
-
4115
- <h2 class="section-heading visually-hidden">User Subscriptions</h2>
4116
-
4117
- <div class="collection insider-collection">
4118
- <div id="times-insider-subscription" class="times-insider-subscription hidden">
4119
- <ul class="theme-news-headlines">
4120
- <li>
4121
- <article class="story">
4122
- <h2 class="story-heading">
4123
- <a href="https://www.nytimes.com/2017/08/26/insider/syphilis-health-investigators-sisterhood-of-sleuths.html">A Sisterhood of Sleuths</a>
4124
- </h2>
4125
- </article>
4126
- </li>
4127
- <li>
4128
- <article class="story">
4129
- <h2 class="story-heading">
4130
- <a href="https://www.nytimes.com/2017/08/30/insider/the-sodden-haunted-fields-of-flanders.html">The Sodden, Haunted Fields of Flanders</a>
4131
- </h2>
4132
- </article>
4133
- </li>
4134
- <li>
4135
- <article class="story">
4136
- <h2 class="story-heading">
4137
- <a href="https://www.nytimes.com/2017/08/25/insider/solar-eclipse-carbondale.html">Seeing the Total Eclipse Through 28,000 Eyes</a>
4138
- </h2>
4139
- </article>
4140
- </li>
4141
- <li>
4142
- <article class="story">
4143
- <h2 class="story-heading">
4144
- <a href="https://www.nytimes.com/2017/08/24/insider/dale-chihuly-glass-artist-creativity.html">A Journalist Glimpses the Tools of an Artist’s Creativity</a>
4145
- </h2>
4146
- </article>
4147
- </li>
4148
- <li>
4149
- <article class="story">
4150
- <h2 class="story-heading">
4151
- <a href="https://www.nytimes.com/module/insider-events"></a>
4152
- </h2>
4153
- </article>
4154
- </li>
4155
- <li>
4156
- <article class="story">
4157
- <h2 class="story-heading">
4158
- <a href="https://www.nytimes.com/2017/07/28/insider/events/cryptoparty-data-security-new-york-times.html">Live Event: Discussing Data Protection at a New York Times ‘CryptoParty’</a>
4159
- </h2>
4160
- </article>
4161
- </li>
4162
- <li>
4163
- <article class="story">
4164
- <h2 class="story-heading">
4165
- <a href="https://www.nytimes.com/2017/08/09/insider/events/live-event-fall-preview-at-joes-pub.html">Live Event: ‘Fall Preview’ at Joe’s Pub</a>
4166
- </h2>
4167
- </article>
4168
- </li>
4169
- <li>
4170
- <article class="story">
4171
- <h2 class="story-heading">
4172
- <a href="https://www.nytimes.com/2017/07/14/insider/events/health-care-conference-call-what-does-policy-actually-mean-for-your-health.html">Live Event: What Do Policy Changes Actually Mean for Your Health?</a>
4173
- </h2>
4174
- </article>
4175
- </li>
4176
- <li>
4177
- <article class="story">
4178
- <h2 class="story-heading">
4179
- <a href="https://www.nytimes.com/2017/06/20/insider/events/new-york-times-podcast-club.html">Live Event: The New York Times Podcast Club</a>
4180
- </h2>
4181
- </article>
4182
- </li>
4183
- </ul>
4184
- <div class="thumb">
4185
- <a href="https://www.nytimes.com/section/insider">
4186
- <svg class="insider-logo" width="65" height="20" role="img" aria-label="Insider">
4187
- <image width="65" height="20" xlink:href="https://a1.nyt.com/assets/homepage/20170810-135137/images/foundation/logos/insider-logo-240x72.svg" src="https://a1.nyt.com/assets/homepage/20170810-135137/images/foundation/logos/insider-logo-240x72.png" alt="Insider" />
4188
- </svg>
4189
- </a>
4190
- </div>
4191
- </div><!--close times-insider-subscription -->
4192
- </div><!-- close collection -->
4193
-
4194
- <div class="collection">
4195
- <div id="times-premier-crossword-subscription" class="times-premier-crossword-subscription hidden">
4196
- <div class="layout split-layout">
4197
- <div class="column">
4198
- <div class="collection insider-collection">
4199
- <article class="story">
4200
- <h3 class="kicker">
4201
- <a href="https://www.nytimes.com/section/insider">Times Insider &raquo;</a>
4202
- </h3>
4203
- <h2 class="story-heading">
4204
- <a href="https://www.nytimes.com/2017/08/26/insider/syphilis-health-investigators-sisterhood-of-sleuths.html">A Sisterhood of Sleuths</a>
4205
- </h2>
4206
- </article>
4207
- </div>
4208
- </div><!-- close column -->
4209
- <div class="column">
4210
- <div class="collection crosswords-collection">
4211
- <article class="story">
4212
- <h3 class="kicker">
4213
- <a href="https://www.nytimes.com/crosswords">The Crossword &raquo;</a>
4214
- </h3>
4215
- <h2 class="story-heading">
4216
- <a href="https://www.nytimes.com/crosswords">Play Today&rsquo;s Puzzle </a>
4217
- </h2>
4218
- <div class="thumb">
4219
- <a href="https://www.nytimes.com/crosswords">
4220
- <img src="https://static01.nyt.com/images/crosswords/crosswords_30x30.png" alt="" />
4221
- </a>
4222
- </div>
4223
- </article>
4224
- </div>
4225
- </div>
4226
- </div><!--close TimesPremiercrossword -->
4227
- </div><!--close times-premier-crossword-subscription -->
4228
- </div><!-- close collection -->
4229
-
4230
- <div class="collection">
4231
- <div id="crossword-subscription" class="crossword-subscription hidden">
4232
- <div class="layout split-layout">
4233
- <div class="column">
4234
- <div class="collection crosswords-collection">
4235
- <article class="story">
4236
- <h3 class="kicker">
4237
- <a href="https://www.nytimes.com/crosswords">The Crossword &raquo;</a>
4238
- </h3>
4239
- <h2 class="story-heading">
4240
- <a href="https://www.nytimes.com/crosswords">Play Today&rsquo;s Puzzle </a>
4241
- </h2>
4242
- <div class="thumb">
4243
- <a href="https://www.nytimes.com/crosswords">
4244
- <img src="https://static01.nyt.com/images/crosswords/crosswords_30x30.png" alt="" />
4245
- </a>
4246
- </div>
4247
- </article>
4248
- </div>
4249
- </div>
4250
- <div class="column">
4251
- <div class="collection crosswords-collection">
4252
- <article class="story">
4253
- <h3 class="kicker">
4254
- <a href="http://wordplay.blogs.nytimes.com">Wordplay &raquo;</a>
4255
- </h3>
4256
- </article>
4257
- </div>
4258
- </div><!-- close column -->
4259
- </div><!-- close layout -->
4260
- </div><!-- close crossword-subscription -->
4261
- </div><!--close collection -->
4262
-
4263
- </section><!-- close user-subscriptions -->
4264
-
4265
- <div id="HPMiddle" class="ad hpmiddle-ad nocontent robots-nocontent"></div>
4266
-
4267
- <div class="region c-column-middle-span-region">
4268
-
4269
- <div class="collection">
4270
- <link rel="stylesheet" type="text/css" href="https://int.nyt.com/apps/portals/assets/portal-6d57ae10010ddcfe80e975e769c6947e.css"/>
4271
-
4272
- <style type="text/css">
4273
- /*HIDE WATCHING HEADER*/
4274
- .portal-container>header { display: none }
4275
- </style>
4276
-
4277
- <div id="nytint-hp-watching">
4278
- <div class="portal-container">
4279
- <header class="portal-header">
4280
- <h4>Watching</h4>
4281
- </header>
4282
- <div class="portal-posts-frame expanded"></div>
4283
- <footer class="portal-footer"></footer>
4284
- </div>
4285
- </div>
4286
-
4287
- <script type="text/javascript">
4288
- require(['foundation/main'], function() {
4289
- require(['homepage/main', 'https://int.nyt.com/apps/portals/assets/portal/app-31573ba689b023d9e52c26c6d6aa32ab.js'
4290
- ], function() {
4291
- require(['portal/app'], function(Portal) {
4292
-
4293
- var opts = {
4294
- env: 'production_published',
4295
- matchHeight: {
4296
- match: '.span-ab-layout.layout > .ab-column',
4297
- container: '.c-column.column',
4298
- maxHeight: 2000
4299
- }
4300
- }
4301
-
4302
- if (window.location.search.indexOf('portal_variant=watchingNoScroll') !== -1) {
4303
- opts.variation = 'simple';
4304
- opts.poll = false;
4305
- opts.limit = 20;
4306
- }
4307
-
4308
- var watching = Portal.create('#nytint-hp-watching', opts);
4309
- });
4310
- });
4311
- });
4312
- </script>
4313
-
4314
- <!-- HpPrototype: WatchingEnabled: DO NOT REMOVE -->
4315
- </div>
4316
-
4317
- </div><!-- close c-column-middle-span-region -->
4318
-
4319
- <div class="region c-column-above-moth-fixed-region">
4320
-
4321
-
4322
- </div><!-- close c-column-above-moth-fixed-region -->
4323
-
4324
- <div class="region c-column-above-moth-region">
4325
-
4326
-
4327
- </div><!-- close c-column-above-moth-region -->
4328
-
4329
- </div><!-- close c-column -->
4330
-
4331
- </div><!-- close span-ab-layout -->
4332
-
4333
- <section id="paid-post-five-pack" class="paid-post-five-pack hidden nocontent robots-nocontent">
4334
- <h2 class="section-heading">From Our Advertisers</h2>
4335
- <ul class="story-menu">
4336
- <li id="PaidPostFivePack1" class="story-menu-item ad"></li>
4337
- <li id="PaidPostFivePack2" class="story-menu-item ad"></li>
4338
- <li id="PaidPostFivePack3" class="story-menu-item ad"></li>
4339
- <li id="PaidPostFivePack4" class="story-menu-item ad"></li>
4340
- <li id="PaidPostFivePack5" class="story-menu-item ad"></li>
4341
- </ul>
4342
- </section>
4343
- <div id="HPBreak" class="ad hpbreak-ad nocontent robots-nocontent hidden"></div>
4344
-
4345
- <div id="video-player-region" class="video-player-region region">
4346
- <div class="collection">
4347
- <div id="video-module-loader" class="loader-container video-section-loader-container">
4348
- <div class="loader loader-t-logo-32x32-ecedeb-ffffff"><span class="visually-hidden">Loading...</span></div>
4349
- </div>
4350
- <section id="video-section"
4351
- class="video-section invisible"
4352
- data-playlist-id="1194811622188"
4353
- data-api-token="cE97ArV7TzqBzkmeRVVhJ8O6GWME2iG_bRvjBTlNb4o."
4354
- data-player-id="2640832222001"
4355
- data-publisher-id="1749339200">
4356
- <header class="section-header">
4357
- <h2 class="section-heading"><a class="times-video-link" href="https://www.nytimes.com/video">times<span>video</span></a></h2>
4358
- <a href="https://www.nytimes.com/video?src=vidm" class="user-action explore-all-videos-link"> explore all videos &raquo;</a>
4359
- </header>
4360
- <div class="column a-column">
4361
- <article class="story">
4362
- <figure class="media video video-player" aria-label="media" role="group">
4363
- <span class="visually-hidden">Video Player</span>
4364
- <img src="" class="poster" alt="" />
4365
- <div class="video-player-container"></div>
4366
- <div class="media-action-overlay"></div>
4367
- <div class="sharetools video-sharetools"
4368
- data-shares="email|,facebook|,twitter|,embed|,show-all|"
4369
- data-url=""
4370
- data-title=""
4371
- data-description=""
4372
- data-content-type="video">
4373
- </div>
4374
- <figcaption class="credit"></figcaption>
4375
- </figure>
4376
- </article>
4377
- </div>
4378
- <div class="column b-column">
4379
- <div id="video-playlist-container" class="video-playlist-container">
4380
- <ul id="video-playlist" class="video-playlist"></ul>
4381
- </div>
4382
- </div> <!-- end b-column -->
4383
- </section>
4384
- </div>
4385
- </div><!-- close video-player-region -->
4386
-
4387
- <section class="inside-nyt">
4388
- <div class="inside-nyt-region region">
4389
- <h2 class="section-heading">Inside Nytimes.com</h2>
4390
- <div id="inside-nyt-browser" class="inside-nyt-browser">
4391
- <div class="navigation-control">
4392
- <button class="button previous deactivated">
4393
- <div class="arrow arrow-left">
4394
- <span class="visually-hidden">Go to the previous story</span>
4395
- <div class="arrow-conceal"></div>
4396
- </div>
4397
- </button>
4398
- <button class="button next">
4399
- <div class="arrow arrow-right">
4400
- <span class="visually-hidden">Go to the next story</span>
4401
- <div class="arrow-conceal"></div>
4402
- </div>
4403
- </button>
4404
- </div>
4405
- <div class="carousel">
4406
- <ol class="menu layout-horizontal theme-story">
4407
- <li>
4408
- <section>
4409
- <h2 class="section-heading"><a href="https://www.nytimes.com/section/theater">Theater</a></h2>
4410
-
4411
- <article class="story theme-summary" data-story-id="100000005387208" data-rank="0" data-collection-renderstyle="Moth">
4412
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/theater/oh-my-sweet-land-amir-nizar-zuabi.html">
4413
- <div class="wide-thumb">
4414
- <img src="https://static01.nyt.com/images/2017/09/03/arts/27SWEETLAND1/27SWEETLAND1-mediumSquare149.jpg" alt="">
4415
- </div>
4416
- <h2 class="story-heading">The Kitchen Is Her Stage</h2>
4417
- </a>
4418
- </article>
4419
-
4420
- </section>
4421
- </li>
4422
- <li>
4423
- <section>
4424
- <h2 class="section-heading"><a href="https://www.nytimes.com/pages/opinion/index.html">Opinion</a></h2>
4425
-
4426
- <article class="story theme-summary" data-story-id="100000005396481" data-rank="1" data-collection-renderstyle="Moth">
4427
- <a class="story-link" href="https://www.nytimes.com/2017/08/29/opinion/transgender-trump-chelsea-manning.html">
4428
- <div class="wide-thumb">
4429
- <img src="https://static01.nyt.com/images/2017/08/29/opinion/29kirchickWeb/29kirchickWeb-mediumSquare149.jpg" alt="">
4430
- </div>
4431
- <h2 class="story-heading">When Transgender Trumps Treachery</h2>
4432
- </a>
4433
- </article>
4434
-
4435
- </section>
4436
- </li>
4437
- <li>
4438
- <section>
4439
- <h2 class="section-heading"><a href="https://www.nytimes.com/section/technology">Technology</a></h2>
4440
-
4441
- <article class="story theme-summary" data-story-id="100000005396461" data-rank="2" data-collection-renderstyle="Moth">
4442
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/technology/doxxing-protests.html">
4443
- <div class="wide-thumb">
4444
- <img src="https://static01.nyt.com/images/2017/08/30/business/30DOXXING5/30DOXXING5-mediumSquare149.jpg" alt="">
4445
- </div>
4446
- <h2 class="story-heading">How ‘Doxxing’ Became a Tool</h2>
4447
- </a>
4448
- </article>
4449
-
4450
- </section>
4451
- </li>
4452
- <li>
4453
- <section>
4454
- <h2 class="section-heading"><a href="https://www.nytimes.com/pages/dining/index.html">Food</a></h2>
4455
-
4456
- <article class="story theme-summary" data-story-id="100000005388364" data-rank="3" data-collection-renderstyle="Moth">
4457
- <a class="story-link" href="https://cooking.nytimes.com/recipes/12965-spaghetti-carbonara">
4458
- <div class="wide-thumb">
4459
- <img src="https://static01.nyt.com/images/2013/12/17/dining/recipes-spaghetticarbonara-copy/recipes-spaghetticarbonara-copy-mediumSquare149.jpg" alt="">
4460
- </div>
4461
- <h2 class="story-heading">How to Make the Best Spaghetti Carbonara</h2>
4462
- </a>
4463
- </article>
4464
-
4465
- </section>
4466
- </li>
4467
- <li>
4468
- <section>
4469
- <h2 class="section-heading"><a href="https://www.nytimes.com/pages/opinion/index.html">Opinion</a></h2>
4470
-
4471
- <article class="story theme-summary" data-story-id="100000005397970" data-rank="4" data-collection-renderstyle="Moth">
4472
- <a class="story-link" href="https://www.nytimes.com/2017/08/29/opinion/harvey-houston-schools-teachers.html">
4473
- <div class="wide-thumb">
4474
- <img src="https://static01.nyt.com/images/2017/08/29/opinion/29danielsSub/29danielsSub-mediumSquare149.jpg" alt="">
4475
- </div>
4476
- <h2 class="story-heading">I Teach in Houston. I’m Worried for My Students.</h2>
4477
- </a>
4478
- </article>
4479
-
4480
- </section>
4481
- </li>
4482
- <li>
4483
- <section>
4484
- <h2 class="section-heading"><a href="https://www.nytimes.com/section/science">Science</a></h2>
4485
-
4486
- <article class="story theme-summary" data-story-id="100000005398035" data-rank="5" data-collection-renderstyle="Moth">
4487
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/science/nova-stars-korea.html">
4488
- <div class="wide-thumb">
4489
- <img src="https://static01.nyt.com/images/2017/08/31/science/31TB-NOVA1/31TB-NOVA1-mediumSquare149.jpg" alt="">
4490
- </div>
4491
- <h2 class="story-heading">The Mystery of a Vanished Star</h2>
4492
- </a>
4493
- </article>
4494
-
4495
- </section>
4496
- </li>
4497
-
4498
- <li>
4499
- <section>
4500
- <h2 class="section-heading"><a href="https://www.nytimes.com/section/arts/design">Art & Design</a></h2>
4501
-
4502
- <article class="story theme-summary" data-story-id="100000005391869" data-rank="0" data-collection-renderstyle="Moth">
4503
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/arts/design/berkshires-elizabeth-king-helen-frankenthaler-clark-art-mass-moca.html">
4504
- <div class="wide-thumb">
4505
- <img src="https://static01.nyt.com/images/2017/09/01/arts/01BERKSHIRETOUR1/01BERKSHIRETOUR1-mediumSquare149.jpg" alt="">
4506
- </div>
4507
- <h2 class="story-heading">Berkshire Tour of Art</h2>
4508
- </a>
4509
- </article>
4510
-
4511
- </section>
4512
- </li>
4513
- <li>
4514
- <section>
4515
- <h2 class="section-heading"><a href="https://www.nytimes.com/pages/opinion/index.html">Opinion</a></h2>
4516
-
4517
- <article class="story theme-summary" data-story-id="100000005396484" data-rank="1" data-collection-renderstyle="Moth">
4518
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/opinion/corporate-tax-cuts-jobs.html">
4519
- <div class="wide-thumb">
4520
- <img src="https://static01.nyt.com/images/2017/08/30/opinion/30anderson/30anderson-mediumSquare149.jpg" alt="">
4521
- </div>
4522
- <h2 class="story-heading">The Corporate Tax Cut Myth</h2>
4523
- </a>
4524
- </article>
4525
-
4526
- </section>
4527
- </li>
4528
- <li>
4529
- <section>
4530
- <h2 class="section-heading"><a href="https://www.nytimes.com/spotlight/times-tips">Smarter Living</a></h2>
4531
-
4532
- <article class="story theme-summary" data-story-id="100000005390050" data-rank="2" data-collection-renderstyle="Moth">
4533
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/smarter-living/how-to-deal-with-all-the-bites-and-stings-of-summer.html">
4534
- <div class="wide-thumb">
4535
- <img src="https://static01.nyt.com/images/2017/08/24/smarter-living/24Bites-smarterLiving-slide-21DI/24Bites-smarterLiving-slide-21DI-mediumSquare149-v2.jpg" alt="">
4536
- </div>
4537
- <h2 class="story-heading">How to Deal With the Stings of Summer</h2>
4538
- </a>
4539
- </article>
4540
-
4541
- </section>
4542
- </li>
4543
- <li>
4544
- <section>
4545
- <h2 class="section-heading"><a href="https://www.nytimes.com/section/fashion">Fashion & Style</a></h2>
4546
-
4547
- <article class="story theme-summary" data-story-id="100000005396095" data-rank="3" data-collection-renderstyle="Moth">
4548
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/fashion/labor-day-weekend-sales-openings.html">
4549
- <div class="wide-thumb">
4550
- <img src="https://static01.nyt.com/images/2017/08/31/fashion/31SCOUTING1combo/31SCOUTING1combo-mediumSquare149.jpg" alt="">
4551
- </div>
4552
- <h2 class="story-heading">Finding Labor Day Weekend’s Best Sales</h2>
4553
- </a>
4554
- </article>
4555
-
4556
- </section>
4557
- </li>
4558
- <li>
4559
- <section>
4560
- <h2 class="section-heading"><a href="https://www.nytimes.com/pages/opinion/index.html">Opinion</a></h2>
4561
-
4562
- <article class="story theme-summary no-thumb" data-story-id="100000005399960" data-rank="4" data-collection-renderstyle="Moth">
4563
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/opinion/washington-remains-united-behind-nato.html">
4564
- <h2 class="story-heading">Washington Remains United Behind NATO</h2>
4565
- <p class="summary">There is a strong consensus that a renaissance of NATO offers the best hope to confront our current threats.</p>
4566
- </a>
4567
- </article>
4568
-
4569
- </section>
4570
- </li>
4571
- <li>
4572
- <section>
4573
- <h2 class="section-heading"><a href="https://www.nytimes.com/section/us">U.S.</a></h2>
4574
-
4575
- <article class="story theme-summary" data-story-id="100000005399999" data-rank="5" data-collection-renderstyle="Moth">
4576
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/us/fire-ants-harvey-hurricane-storm.html">
4577
- <div class="wide-thumb">
4578
- <img src="https://static01.nyt.com/images/2017/08/31/us/31xp-fireants/merlin-to-scoop-126550571-982068-mediumSquare149.jpg" alt="">
4579
- </div>
4580
- <h2 class="story-heading">Hazard in Houston? Fire Ants</h2>
4581
- </a>
4582
- </article>
4583
-
4584
- </section>
4585
- </li>
4586
-
4587
- </ol>
4588
- </div>
4589
- </div>
4590
- </div>
4591
- </section>
4592
-
4593
- <div id="HPMidLeader" class="ad hpmidleader-ad nocontent robots-nocontent"></div>
4594
-
4595
- <div class="span-ab-layout layout">
4596
-
4597
- <div class="ab-column column">
4598
-
4599
- <hr class="scotch-rule" />
4600
-
4601
- <section class="well">
4602
- <div class="region well-region">
4603
- <h2 class="section-heading visually-hidden">Sections</h2>
4604
-
4605
-
4606
- <div class="split-3-layout layout theme-base">
4607
-
4608
-
4609
- <div class="column ">
4610
-
4611
- <section>
4612
- <h2 class="section-heading">
4613
- <a href="https://www.nytimes.com/pages/world/index.html">World &raquo;</a>
4614
- </h2>
4615
- <ul>
4616
- <li>
4617
- <article class="story theme-summary" data-story-id="100000005392389" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4618
-
4619
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/world/canada/canada-climate-change-arctic.html">
4620
-
4621
- <div class="thumb">
4622
- <img src="https://static01.nyt.com/images/2017/08/31/world/americas/31CanadaChurchill1/churchill-slide-GEXA-thumbStandard.jpg" alt="" />
4623
- </div>
4624
-
4625
- <h3 class="story-heading">
4626
- Churchill Journal: Canadian Town, Isolated After Losing Rail Link, ‘Feels Held Hostage’ </h3>
4627
- </a>
4628
- </article>
4629
- </li>
4630
- <li>
4631
- <article class="story" data-story-id="100000005399498" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4632
- <h2 class="story-heading">
4633
- <a href="https://www.nytimes.com/2017/08/30/world/asia/north-korea-south-korea-missile-pictures-bomb.html">
4634
- After Missile Tests, North and South Korea Wage War of Pictures </a>
4635
- </h2>
4636
- </article>
4637
- </li>
4638
- <li>
4639
- <article class="story" data-story-id="100000005401178" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4640
- <h2 class="story-heading">
4641
- <a href="https://www.nytimes.com/2017/08/30/world/americas/brazil-amazon-mining-temer-environmentalists-judge.html">
4642
- Brazilian Judge Stymies Plan to Allow Mining in Amazon Region </a>
4643
- </h2>
4644
- </article>
4645
- </li>
4646
- </ul>
4647
- </section>
4648
-
4649
- </div> <!-- close column -->
4650
-
4651
-
4652
- <div class="column ">
4653
-
4654
- <section>
4655
- <h2 class="section-heading">
4656
- <a href="https://www.nytimes.com/pages/business/index.html">Business Day &raquo;</a>
4657
- </h2>
4658
- <ul>
4659
- <li>
4660
- <article class="story theme-summary" data-story-id="100000005399538" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4661
-
4662
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/technology/personaltech/future-smartphone-camera-augmented-reality.html">
4663
-
4664
- <div class="thumb">
4665
- <img src="https://static01.nyt.com/images/2017/08/31/business/31techfix/31techfix-thumbStandard.jpg" alt="" />
4666
- </div>
4667
-
4668
- <h3 class="story-heading">
4669
- Tech Fix: The Smartphone’s Future: It’s All About the Camera </h3>
4670
- </a>
4671
- </article>
4672
- </li>
4673
- <li>
4674
- <article class="story" data-story-id="100000005400786" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4675
- <h2 class="story-heading">
4676
- <a href="https://www.nytimes.com/2017/08/30/health/gene-therapy-cancer.html">
4677
- F.D.A. Approves First Gene-Altering Leukemia Treatment, Costing $475,000 </a>
4678
- </h2>
4679
- </article>
4680
- </li>
4681
- <li>
4682
- <article class="story" data-story-id="100000005396254" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4683
- <h2 class="story-heading">
4684
- <a href="https://www.nytimes.com/2017/08/30/business/media/nfl-six-second-commercials.html">
4685
- Six-Second Commercials Are Coming to N.F.L. Games on Fox </a>
4686
- </h2>
4687
- </article>
4688
- </li>
4689
- </ul>
4690
- </section>
4691
-
4692
- </div> <!-- close column -->
4693
-
4694
-
4695
- <div class="column last-column">
4696
-
4697
- <section>
4698
- <h2 class="section-heading">
4699
- <a href="https://www.nytimes.com/pages/opinion/index.html">Opinion &raquo;</a>
4700
- </h2>
4701
- <ul>
4702
- <li>
4703
- <article class="story theme-summary" data-story-id="100000005400487" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4704
-
4705
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/opinion/trump-osteen-harvey-church.html">
4706
-
4707
- <div class="thumb">
4708
- <img src="https://static01.nyt.com/images/2017/08/30/opinion/30butlerWeb/30butlerWeb-thumbStandard.jpg" alt="" />
4709
- </div>
4710
-
4711
- <h3 class="story-heading">
4712
- Op-Ed Contributor: The Cheap Prosperity Gospel of Trump and Osteen </h3>
4713
- </a>
4714
- </article>
4715
- </li>
4716
- <li>
4717
- <article class="story" data-story-id="100000005400536" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4718
- <h2 class="story-heading">
4719
- <a href="https://www.nytimes.com/2017/08/31/opinion/voting-reform-illinois-texas.html">
4720
- Editorial: On Voting Reforms, Follow Illinois, Not Texas </a>
4721
- </h2>
4722
- </article>
4723
- </li>
4724
- <li>
4725
- <article class="story" data-story-id="100000005401080" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4726
- <h2 class="story-heading">
4727
- <a href="https://www.nytimes.com/2017/08/31/opinion/trump-harvey-storm-army.html">
4728
- Charles M. Blow: Trump Raises an Army </a>
4729
- </h2>
4730
- </article>
4731
- </li>
4732
- </ul>
4733
- </section>
4734
-
4735
- </div> <!-- close column -->
4736
-
4737
-
4738
- </div><!-- close split-3-layout -->
4739
-
4740
-
4741
- <div class="split-3-layout layout theme-base">
4742
-
4743
-
4744
- <div class="column ">
4745
-
4746
- <section>
4747
- <h2 class="section-heading">
4748
- <a href="https://www.nytimes.com/section/us">U.S. &raquo;</a>
4749
- </h2>
4750
- <ul>
4751
- <li>
4752
- <article class="story theme-summary" data-story-id="100000005401006" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4753
-
4754
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/us/small-towns-harvey.html">
4755
-
4756
- <div class="thumb">
4757
- <img src="https://static01.nyt.com/images/2017/08/31/us/31towns4/31towns4-thumbStandard.jpg" alt="" />
4758
- </div>
4759
-
4760
- <h3 class="story-heading">
4761
- As Houston Looks to Recover, Small Towns Now Bear the Brunt </h3>
4762
- </a>
4763
- </article>
4764
- </li>
4765
- <li>
4766
- <article class="story" data-story-id="100000005401457" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4767
- <h2 class="story-heading">
4768
- <a href="https://www.nytimes.com/interactive/2017/08/30/us/houston-flood-rescue-cries-for-help.html">
4769
- Thousands Cried for Help as Houston Flooded </a>
4770
- </h2>
4771
- </article>
4772
- </li>
4773
- <li>
4774
- <article class="story" data-story-id="100000005399973" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4775
- <h2 class="story-heading">
4776
- <a href="https://www.nytimes.com/2017/08/30/us/port-arthur-flooding.html">
4777
- Port Arthur Faces Harvey Flooding Disaster: ‘Our Whole City Is Underwater’ </a>
4778
- </h2>
4779
- </article>
4780
- </li>
4781
- </ul>
4782
- </section>
4783
-
4784
- </div> <!-- close column -->
4785
-
4786
-
4787
- <div class="column ">
4788
-
4789
- <section>
4790
- <h2 class="section-heading">
4791
- <a href="https://www.nytimes.com/pages/technology/index.html">Technology &raquo;</a>
4792
- </h2>
4793
- <ul>
4794
- <li>
4795
- <article class="story theme-summary" data-story-id="100000005399538" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4796
-
4797
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/technology/personaltech/future-smartphone-camera-augmented-reality.html">
4798
-
4799
-
4800
- <h3 class="story-heading">
4801
- Tech Fix: The Smartphone’s Future: It’s All About the Camera </h3>
4802
- </a>
4803
- </article>
4804
- </li>
4805
- <li>
4806
- <article class="story" data-story-id="100000005396461" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4807
- <h2 class="story-heading">
4808
- <a href="https://www.nytimes.com/2017/08/30/technology/doxxing-protests.html">
4809
- How ‘Doxxing’ Became a Mainstream Tool in the Culture Wars </a>
4810
- </h2>
4811
- </article>
4812
- </li>
4813
- <li>
4814
- <article class="story" data-story-id="100000005393341" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4815
- <h2 class="story-heading">
4816
- <a href="https://www.nytimes.com/2017/08/30/technology/kalanick-benchmark-uber-delaware.html">
4817
- Kalanick’s Feud With Benchmark Goes to Arbitration for Now, Judge Rules </a>
4818
- </h2>
4819
- </article>
4820
- </li>
4821
- </ul>
4822
- </section>
4823
-
4824
- </div> <!-- close column -->
4825
-
4826
-
4827
- <div class="column last-column">
4828
-
4829
- <section>
4830
- <h2 class="section-heading">
4831
- <a href="https://www.nytimes.com/pages/arts/index.html">Arts &raquo;</a>
4832
- </h2>
4833
- <ul>
4834
- <li>
4835
- <article class="story theme-summary" data-story-id="100000005385152" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4836
-
4837
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/arts/design/maiolino-museum-of-contemporary-art.html">
4838
-
4839
- <div class="thumb">
4840
- <img src="https://static01.nyt.com/images/2017/09/01/arts/01MAIOLINO1/01MAIOLINO1-thumbStandard.jpg" alt="" />
4841
- </div>
4842
-
4843
- <h3 class="story-heading">
4844
- art review: Weekend in Los Angeles: That Touch of Brazil </h3>
4845
- </a>
4846
- </article>
4847
- </li>
4848
- <li>
4849
- <article class="story" data-story-id="100000005398883" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4850
- <h2 class="story-heading">
4851
- <a href="https://www.nytimes.com/2017/08/30/arts/television/uk-gbbo-great-british-bake-off-channel-4.html">
4852
- ‘Great British Bake Off’ Is Still a Treat for Many Viewers </a>
4853
- </h2>
4854
- </article>
4855
- </li>
4856
- <li>
4857
- <article class="story" data-story-id="100000005399033" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4858
- <h2 class="story-heading">
4859
- <a href="https://www.nytimes.com/2017/08/30/books/review-cuz-danielle-allen.html">
4860
- Books of The Times: ‘Cuz’ Mourns a Loss and Denounces a System </a>
4861
- </h2>
4862
- </article>
4863
- </li>
4864
- </ul>
4865
- </section>
4866
-
4867
- </div> <!-- close column -->
4868
-
4869
-
4870
- </div><!-- close split-3-layout -->
4871
-
4872
-
4873
- <div class="split-3-layout layout theme-base">
4874
-
4875
-
4876
- <div class="column ">
4877
-
4878
- <section>
4879
- <h2 class="section-heading">
4880
- <a href="https://www.nytimes.com/pages/politics/index.html">Politics &raquo;</a>
4881
- </h2>
4882
- <ul>
4883
- <li>
4884
- <article class="story theme-summary" data-story-id="100000005401238" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4885
-
4886
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/us/politics/us-aid-pakistan-terror.html">
4887
-
4888
- <div class="thumb">
4889
- <img src="https://static01.nyt.com/images/2017/08/31/us/31dc-diplo/31dc-diplo-thumbStandard.jpg" alt="" />
4890
- </div>
4891
-
4892
- <h3 class="story-heading">
4893
- U.S. Gives Military Assistance to Pakistan, With Strings Attached </h3>
4894
- </a>
4895
- </article>
4896
- </li>
4897
- <li>
4898
- <article class="story" data-story-id="100000005401018" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4899
- <h2 class="story-heading">
4900
- <a href="https://www.nytimes.com/2017/08/30/us/politics/trump-obamacare-enrollment-markets-subsidies.html">
4901
- Trump Administration Wants to Stabilize Health Markets but Won’t Say How </a>
4902
- </h2>
4903
- </article>
4904
- </li>
4905
- <li>
4906
- <article class="story" data-story-id="100000005400924" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4907
- <h2 class="story-heading">
4908
- <a href="https://www.nytimes.com/2017/08/30/us/politics/hurricane-sandy-relief-fact-check.html">
4909
- Fact Check: Was 2013 Hurricane Sandy Relief Package ‘Full of Pork’? </a>
4910
- </h2>
4911
- </article>
4912
- </li>
4913
- </ul>
4914
- </section>
4915
-
4916
- </div> <!-- close column -->
4917
-
4918
-
4919
- <div class="column ">
4920
-
4921
- <section>
4922
- <h2 class="section-heading">
4923
- <a href="https://www.nytimes.com/section/fashion">Fashion & Style &raquo;</a>
4924
- </h2>
4925
- <ul>
4926
- <li>
4927
- <article class="story theme-summary" data-story-id="100000005398042" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4928
-
4929
- <a class="story-link" href="https://www.nytimes.com/2017/08/31/fashion/jean-paul-goude-desigual.html">
4930
-
4931
- <div class="thumb">
4932
- <img src="https://static01.nyt.com/images/2017/08/31/fashion/31UNBUTTONED-1/31UNBUTTONED-1-thumbStandard.jpg" alt="" />
4933
- </div>
4934
-
4935
- <h3 class="story-heading">
4936
- Unbuttoned: Desigual Turns to Jean-Paul Goude for a Makeover </h3>
4937
- </a>
4938
- </article>
4939
- </li>
4940
- <li>
4941
- <article class="story" data-story-id="100000005396488" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4942
- <h2 class="story-heading">
4943
- <a href="https://www.nytimes.com/2017/08/30/fashion/uncle-brother-catskills-gavin-brown.html">
4944
- A Catskills Art Scene Makes a Splash With Free Curry </a>
4945
- </h2>
4946
- </article>
4947
- </li>
4948
- <li>
4949
- <article class="story" data-story-id="100000005373132" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4950
- <h2 class="story-heading">
4951
- <a href="https://www.nytimes.com/2017/08/30/fashion/aura-photography-radiant-human.html">
4952
- Me Time: Aura Photographs: Selfies for the New Age Set </a>
4953
- </h2>
4954
- </article>
4955
- </li>
4956
- </ul>
4957
- </section>
4958
-
4959
- </div> <!-- close column -->
4960
-
4961
-
4962
- <div class="column last-column">
4963
-
4964
- <section>
4965
- <h2 class="section-heading">
4966
- <a href="https://www.nytimes.com/section/movies">Movies &raquo;</a>
4967
- </h2>
4968
- <ul>
4969
- <li>
4970
- <article class="story theme-summary" data-story-id="100000005389037" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
4971
-
4972
- <a class="story-link" href="https://www.nytimes.com/2017/08/29/movies/amid-gung-ho-mentality-stunt-deaths-renew-a-debate-over-safety.html">
4973
-
4974
- <div class="thumb">
4975
- <img src="https://static01.nyt.com/images/2017/08/30/arts/29STUNT3/29STUNT3-thumbStandard.jpg" alt="" />
4976
- </div>
4977
-
4978
- <h3 class="story-heading">
4979
- Amid ‘Gung-Ho Mentality,’ Stunt Deaths Renew a Debate Over Safety </h3>
4980
- </a>
4981
- </article>
4982
- </li>
4983
- <li>
4984
- <article class="story" data-story-id="100000005364809" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
4985
- <h2 class="story-heading">
4986
- <a href="https://www.nytimes.com/2017/08/28/movies/venice-film-festival-opening-stars-matt-damon-kristen-wiig.html">
4987
- Venice Film Festival Opening Stars Matt Damon and Kristen Wiig </a>
4988
- </h2>
4989
- </article>
4990
- </li>
4991
- <li>
4992
- <article class="story" data-story-id="100000005395796" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
4993
- <h2 class="story-heading">
4994
- <a href="https://www.nytimes.com/2017/08/28/movies/texas-chain-saw-massacre-tobe-hooper-appraisal.html">
4995
- An Appraisal: In ‘Texas Chain Saw Massacre,’ Sympathy for the Devil </a>
4996
- </h2>
4997
- </article>
4998
- </li>
4999
- </ul>
5000
- </section>
5001
-
5002
- </div> <!-- close column -->
5003
-
5004
-
5005
- </div><!-- close split-3-layout -->
5006
-
5007
-
5008
- <div class="split-3-layout layout theme-base">
5009
-
5010
-
5011
- <div class="column ">
5012
-
5013
- <section>
5014
- <h2 class="section-heading">
5015
- <a href="https://www.nytimes.com/section/nyregion">New York &raquo;</a>
5016
- </h2>
5017
- <ul>
5018
- <li>
5019
- <article class="story theme-summary" data-story-id="100000005386266" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5020
-
5021
- <a class="story-link" href="https://www.nytimes.com/2017/08/31/nyregion/new-york-today-hurricanes-in-nyc-harvey-tropical-storm.html">
5022
-
5023
- <div class="thumb">
5024
- <img src="https://static01.nyt.com/images/2017/08/31/nyregion/31NYTODAY1/31NYTODAY1-thumbStandard.jpg" alt="" />
5025
- </div>
5026
-
5027
- <h3 class="story-heading">
5028
- New York Today: New York Today: Reflecting on Harvey, in the Northeast </h3>
5029
- </a>
5030
- </article>
5031
- </li>
5032
- <li>
5033
- <article class="story" data-story-id="100000005400160" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5034
- <h2 class="story-heading">
5035
- <a href="https://www.nytimes.com/2017/08/30/nyregion/ordering-review-of-statues-puts-de-blasio-in-tricky-spot.html">
5036
- Ordering Review of Statues Puts de Blasio in Tricky Spot </a>
5037
- </h2>
5038
- </article>
5039
- </li>
5040
- <li>
5041
- <article class="story" data-story-id="100000005398633" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5042
- <h2 class="story-heading">
5043
- <a href="https://www.nytimes.com/2017/08/30/nyregion/instagram-places-new-york-travel.html">
5044
- New York City’s Newest Hot Spot? Check Instagram </a>
5045
- </h2>
5046
- </article>
5047
- </li>
5048
- </ul>
5049
- </section>
5050
-
5051
- </div> <!-- close column -->
5052
-
5053
-
5054
- <div class="column ">
5055
-
5056
- <section>
5057
- <h2 class="section-heading">
5058
- <a href="https://www.nytimes.com/pages/sports/index.html">Sports &raquo;</a>
5059
- </h2>
5060
- <ul>
5061
- <li>
5062
- <article class="story theme-summary" data-story-id="100000005399955" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5063
-
5064
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/sports/espn-ed-cunningham-football-concussions.html">
5065
-
5066
- <div class="thumb">
5067
- <img src="https://static01.nyt.com/images/2017/08/31/sports/31BRAINSweb1/31BRAINSweb1-thumbStandard.jpg" alt="" />
5068
- </div>
5069
-
5070
- <h3 class="story-heading">
5071
- ESPN Football Analyst Walks Away, Disturbed by Brain Trauma on Field </h3>
5072
- </a>
5073
- </article>
5074
- </li>
5075
- <li>
5076
- <article class="story" data-story-id="100000005401613" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5077
- <h2 class="story-heading">
5078
- <a href="https://www.nytimes.com/2017/08/31/sports/tennis/alexander-zverev-borna-coric-us-open.html">
5079
- Two Zverevs Take the Court in Queens, and Only One Advances </a>
5080
- </h2>
5081
- </article>
5082
- </li>
5083
- <li>
5084
- <article class="story" data-story-id="100000005395156" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5085
- <h2 class="story-heading">
5086
- <a href="https://www.nytimes.com/2017/08/30/sports/olympics/munich-olympic-massacre-1972-memorial-israeli-athletes.html">
5087
- In Munich, a Tribute to Israeli Athletes and Families’ Persistence </a>
5088
- </h2>
5089
- </article>
5090
- </li>
5091
- </ul>
5092
- </section>
5093
-
5094
- </div> <!-- close column -->
5095
-
5096
-
5097
- <div class="column last-column">
5098
-
5099
- <section>
5100
- <h2 class="section-heading">
5101
- <a href="https://www.nytimes.com/pages/theater/index.html">Theater &raquo;</a>
5102
- </h2>
5103
- <ul>
5104
- <li>
5105
- <article class="story theme-summary" data-story-id="100000005387208" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5106
-
5107
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/theater/oh-my-sweet-land-amir-nizar-zuabi.html">
5108
-
5109
- <div class="thumb">
5110
- <img src="https://static01.nyt.com/images/2017/09/03/arts/27SWEETLAND1/27SWEETLAND1-thumbStandard.jpg" alt="" />
5111
- </div>
5112
-
5113
- <h3 class="story-heading">
5114
- The Kitchen Is Her Stage. (It Could Actually Be Your Kitchen.) </h3>
5115
- </a>
5116
- </article>
5117
- </li>
5118
- <li>
5119
- <article class="story" data-story-id="100000005364092" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5120
- <h2 class="story-heading">
5121
- <a href="https://www.nytimes.com/2017/08/30/theater/eavesdropping-on-warhol-and-capote.html">
5122
- Eavesdropping on Warhol and Capote </a>
5123
- </h2>
5124
- </article>
5125
- </li>
5126
- <li>
5127
- <article class="story" data-story-id="100000005360538" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5128
- <h2 class="story-heading">
5129
- <a href="https://www.nytimes.com/2017/08/29/theater/great-comet-broadway-race.html">
5130
- Race, Money and Broadway: How ‘Great Comet’ Burned Out </a>
5131
- </h2>
5132
- </article>
5133
- </li>
5134
- </ul>
5135
- </section>
5136
-
5137
- </div> <!-- close column -->
5138
-
5139
-
5140
- </div><!-- close split-3-layout -->
5141
-
5142
-
5143
- <div class="split-3-layout layout theme-base">
5144
-
5145
-
5146
- <div class="column ">
5147
-
5148
- <section>
5149
- <h2 class="section-heading">
5150
- <a href="https://www.nytimes.com/section/science">Science &raquo;</a>
5151
- </h2>
5152
- <ul>
5153
- <li>
5154
- <article class="story theme-summary" data-story-id="100000005343497" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5155
-
5156
- <a class="story-link" href="https://www.nytimes.com/video/science/100000005343497/forty-years-of-voyager.html">
5157
-
5158
- <div class="thumb">
5159
- <img src="https://static01.nyt.com/images/2017/08/29/multimedia/Voyager-Thumb1/Voyager-Thumb1-thumbStandard.png" alt="" />
5160
- </div>
5161
-
5162
- <h3 class="story-heading">
5163
- Forty Years of Voyager </h3>
5164
- </a>
5165
- </article>
5166
- </li>
5167
- <li>
5168
- <article class="story" data-story-id="100000005398035" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5169
- <h2 class="story-heading">
5170
- <a href="https://www.nytimes.com/2017/08/30/science/nova-stars-korea.html">
5171
- Trilobites: Casting Light on Mystery of a Star That Vanished After 14 Days </a>
5172
- </h2>
5173
- </article>
5174
- </li>
5175
- <li>
5176
- <article class="story" data-story-id="100000005396021" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5177
- <h2 class="story-heading">
5178
- <a href="https://www.nytimes.com/2017/08/29/science/trigonometry-babylonian-tablet.html">
5179
- Trilobites: Hints of Trigonometry on a 3,700-Year-Old Babylonian Tablet </a>
5180
- </h2>
5181
- </article>
5182
- </li>
5183
- </ul>
5184
- </section>
5185
-
5186
- </div> <!-- close column -->
5187
-
5188
-
5189
- <div class="column ">
5190
-
5191
- <section>
5192
- <h2 class="section-heading">
5193
- <a href="https://www.nytimes.com/section/obituaries">Obituaries &raquo;</a>
5194
- </h2>
5195
- <ul>
5196
- <li>
5197
- <article class="story theme-summary" data-story-id="100000005401130" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5198
-
5199
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/sports/ncaabasketball/villanova-coach-rollie-massimino-dead.html">
5200
-
5201
- <div class="thumb">
5202
- <img src="https://static01.nyt.com/images/2017/08/30/obituaries/30massimino1/30massimino1-thumbStandard.jpg" alt="" />
5203
- </div>
5204
-
5205
- <h3 class="story-heading">
5206
- Rollie Massimino, 82, Dies; Rode Dark Horse Villanova to Basketball Glory </h3>
5207
- </a>
5208
- </article>
5209
- </li>
5210
- <li>
5211
- <article class="story" data-story-id="100000005398288" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5212
- <h2 class="story-heading">
5213
- <a href="https://www.nytimes.com/2017/08/30/sports/basketball/jud-heathcote-dead-coached-michigan-state-to-basketball-title.html">
5214
- Jud Heathcote, 90, Dies; Coached Michigan State to Basketball Title </a>
5215
- </h2>
5216
- </article>
5217
- </li>
5218
- <li>
5219
- <article class="story" data-story-id="100000005399785" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5220
- <h2 class="story-heading">
5221
- <a href="https://www.nytimes.com/2017/08/30/business/david-tang-dead-fashion-retailer.html">
5222
- David Tang, Fashion Retailer and Raconteur, Dies at 63 </a>
5223
- </h2>
5224
- </article>
5225
- </li>
5226
- </ul>
5227
- </section>
5228
-
5229
- </div> <!-- close column -->
5230
-
5231
-
5232
- <div class="column last-column">
5233
-
5234
- <section>
5235
- <h2 class="section-heading">
5236
- <a href="https://www.nytimes.com/section/arts/television">Television &raquo;</a>
5237
- </h2>
5238
- <ul>
5239
- <li>
5240
- <article class="story theme-summary" data-story-id="100000005398883" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5241
-
5242
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/arts/television/uk-gbbo-great-british-bake-off-channel-4.html">
5243
-
5244
- <div class="thumb">
5245
- <img src="https://static01.nyt.com/images/2017/08/31/arts/31BAKEOFF-ROUNDUP/31BAKEOFF-ROUNDUP-thumbStandard-v2.jpg" alt="" />
5246
- </div>
5247
-
5248
- <h3 class="story-heading">
5249
- ‘Great British Bake Off’ Is Still a Treat for Many Viewers </h3>
5250
- </a>
5251
- </article>
5252
- </li>
5253
- <li>
5254
- <article class="story" data-story-id="100000005367164" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5255
- <h2 class="story-heading">
5256
- <a href="https://www.nytimes.com/2017/08/24/arts/television/the-deuce-hbo-david-simon.html">
5257
- ‘The Deuce’ Recalls Sex and Sleaze in 1970s Times Square </a>
5258
- </h2>
5259
- </article>
5260
- </li>
5261
- <li>
5262
- <article class="story" data-story-id="100000005396266" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5263
- <h2 class="story-heading">
5264
- <a href="https://www.nytimes.com/interactive/2017/08/29/watching/fall-tv-sf-promo.html">
5265
- Watching: Your Catch-Up Guide to the Best Shows Returning This Fall </a>
5266
- </h2>
5267
- </article>
5268
- </li>
5269
- </ul>
5270
- </section>
5271
-
5272
- </div> <!-- close column -->
5273
-
5274
-
5275
- </div><!-- close split-3-layout -->
5276
-
5277
-
5278
- <div class="split-3-layout layout theme-base">
5279
-
5280
-
5281
- <div class="column ">
5282
-
5283
- <section>
5284
- <h2 class="section-heading">
5285
- <a href="https://www.nytimes.com/pages/health/index.html">Health &raquo;</a>
5286
- </h2>
5287
- <ul>
5288
- <li>
5289
- <article class="story theme-summary" data-story-id="100000005400786" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5290
-
5291
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/health/gene-therapy-cancer.html">
5292
-
5293
- <div class="thumb">
5294
- <img src="https://static01.nyt.com/images/2017/08/31/science/31GENE3/31GENE3-thumbStandard.jpg" alt="" />
5295
- </div>
5296
-
5297
- <h3 class="story-heading">
5298
- F.D.A. Approves First Gene-Altering Leukemia Treatment, Costing $475,000 </h3>
5299
- </a>
5300
- </article>
5301
- </li>
5302
- <li>
5303
- <article class="story" data-story-id="100000005390415" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5304
- <h2 class="story-heading">
5305
- <a href="https://www.nytimes.com/2017/08/29/business/economy/home-health-care-work.html">
5306
- Economic Scene: Home Health Care: Shouldn’t It Be Work Worth Doing? </a>
5307
- </h2>
5308
- </article>
5309
- </li>
5310
- <li>
5311
- <article class="story" data-story-id="100000005395934" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5312
- <h2 class="story-heading">
5313
- <a href="https://www.nytimes.com/2017/08/28/health/fda-stem-cell.html">
5314
- F.D.A. Cracks Down on ‘Unscrupulous’ Stem Cell Clinics </a>
5315
- </h2>
5316
- </article>
5317
- </li>
5318
- </ul>
5319
- </section>
5320
-
5321
- </div> <!-- close column -->
5322
-
5323
-
5324
- <div class="column ">
5325
-
5326
- <section>
5327
- <h2 class="section-heading">
5328
- <a href="https://www.nytimes.com/section/travel">Travel &raquo;</a>
5329
- </h2>
5330
- <ul>
5331
- <li>
5332
- <article class="story theme-summary" data-story-id="100000004599829" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5333
-
5334
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/travel/peaceful-island-indonesia.html">
5335
-
5336
- <div class="thumb">
5337
- <img src="https://static01.nyt.com/images/2017/09/10/travel/10gili1/30gili1-thumbStandard.jpg" alt="" />
5338
- </div>
5339
-
5340
- <h3 class="story-heading">
5341
- Next Stop: This Indonesian Island Is a Respite From Bali. At Least for Now. </h3>
5342
- </a>
5343
- </article>
5344
- </li>
5345
- <li>
5346
- <article class="story" data-story-id="100000005388668" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5347
- <h2 class="story-heading">
5348
- <a href="https://www.nytimes.com/interactive/2017/08/29/travel/what-to-do-36-hours-in-trieste-italy.html">
5349
- 36 Hours: 36 Hours in Trieste, Italy </a>
5350
- </h2>
5351
- </article>
5352
- </li>
5353
- <li>
5354
- <article class="story" data-story-id="100000005385852" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5355
- <h2 class="story-heading">
5356
- <a href="https://www.nytimes.com/2017/08/28/travel/kodiak-travel-photography.html">
5357
- Photo Essay: Our Stunning World </a>
5358
- </h2>
5359
- </article>
5360
- </li>
5361
- </ul>
5362
- </section>
5363
-
5364
- </div> <!-- close column -->
5365
-
5366
-
5367
- <div class="column last-column">
5368
-
5369
- <section>
5370
- <h2 class="section-heading">
5371
- <a href="https://www.nytimes.com/section/books">Books &raquo;</a>
5372
- </h2>
5373
- <ul>
5374
- <li>
5375
- <article class="story theme-summary" data-story-id="100000005399033" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5376
-
5377
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/books/review-cuz-danielle-allen.html">
5378
-
5379
- <div class="thumb">
5380
- <img src="https://static01.nyt.com/images/2017/08/31/books/31bookallen2/31bookallen2-thumbStandard.jpg" alt="" />
5381
- </div>
5382
-
5383
- <h3 class="story-heading">
5384
- Books of The Times: ‘Cuz’ Mourns a Loss and Denounces a System </h3>
5385
- </a>
5386
- </article>
5387
- </li>
5388
- <li>
5389
- <article class="story" data-story-id="100000005396584" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5390
- <h2 class="story-heading">
5391
- <a href="https://www.nytimes.com/2017/08/29/books/review-my-absolute-darling-gabriel-tallent.html">
5392
- Books of The Times: A Heroine in the Mold of Huck and Scout </a>
5393
- </h2>
5394
- </article>
5395
- </li>
5396
- <li>
5397
- <article class="story" data-story-id="100000005395901" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5398
- <h2 class="story-heading">
5399
- <a href="https://www.nytimes.com/2017/08/28/books/review-john-le-carre-legacy-of-spies.html">
5400
- Books of The Times: George Smiley and Other Old Friends Return in John le Carré’s ‘A Legacy of Spies’ </a>
5401
- </h2>
5402
- </article>
5403
- </li>
5404
- </ul>
5405
- </section>
5406
-
5407
- </div> <!-- close column -->
5408
-
5409
-
5410
- </div><!-- close split-3-layout -->
5411
-
5412
-
5413
- <div class="split-3-layout layout theme-base">
5414
-
5415
-
5416
- <div class="column ">
5417
-
5418
- <section>
5419
- <h2 class="section-heading">
5420
- <a href="https://www.nytimes.com/section/education">Education &raquo;</a>
5421
- </h2>
5422
- <ul>
5423
- <li>
5424
- <article class="story theme-summary" data-story-id="100000005337043" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5425
-
5426
- <a class="story-link" href="https://www.nytimes.com/interactive/2017/08/24/us/affirmative-action.html">
5427
-
5428
- <div class="thumb">
5429
- <img src="https://static01.nyt.com/images/2017/08/03/us/affirmative-action-in-colleges-and-representation-of-blacks-and-hispanics-1503525136789/affirmative-action-in-colleges-and-representation-of-blacks-and-hispanics-1503525136789-thumbStandard-v5.png" alt="" />
5430
- </div>
5431
-
5432
- <h3 class="story-heading">
5433
- Even With Affirmative Action, Blacks and Hispanics Are More Underrepresented at Top Colleges Than 35 Years Ago </h3>
5434
- </a>
5435
- </article>
5436
- </li>
5437
- <li>
5438
- <article class="story" data-story-id="100000005348802" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5439
- <h2 class="story-heading">
5440
- <a href="https://www.nytimes.com/2017/08/24/technology/coding-boot-camps-close.html">
5441
- As Coding Boot Camps Close, the Field Faces a Reality Check </a>
5442
- </h2>
5443
- </article>
5444
- </li>
5445
- <li>
5446
- <article class="story" data-story-id="100000005384528" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5447
- <h2 class="story-heading">
5448
- <a href="https://www.nytimes.com/2017/08/22/opinion/washington-lee-university-trump-nationalism.html">
5449
- On Campus: My University Is Named for Robert E. Lee. What Now? </a>
5450
- </h2>
5451
- </article>
5452
- </li>
5453
- </ul>
5454
- </section>
5455
-
5456
- </div> <!-- close column -->
5457
-
5458
-
5459
- <div class="column ">
5460
-
5461
- <section>
5462
- <h2 class="section-heading">
5463
- <a href="https://www.nytimes.com/pages/dining/index.html">Food &raquo;</a>
5464
- </h2>
5465
- <ul>
5466
- <li>
5467
- <article class="story theme-summary" data-story-id="100000005387948" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5468
-
5469
- <a class="story-link" href="https://www.nytimes.com/2017/08/29/dining/restaurant-wish-list-pete-wells.html">
5470
-
5471
- <div class="thumb">
5472
- <img src="https://static01.nyt.com/images/2017/08/30/dining/30WISH3/30WISH3-thumbStandard-v2.jpg" alt="" />
5473
- </div>
5474
-
5475
- <h3 class="story-heading">
5476
- Critic’s Notebook: A Wish List for New Restaurants </h3>
5477
- </a>
5478
- </article>
5479
- </li>
5480
- <li>
5481
- <article class="story" data-story-id="100000005390036" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5482
- <h2 class="story-heading">
5483
- <a href="https://www.nytimes.com/2017/08/30/dining/mashed-potato-salad-recipe.html">
5484
- A Good Appetite: An Accidentally Creamier, Fluffier Potato Salad </a>
5485
- </h2>
5486
- </article>
5487
- </li>
5488
- <li>
5489
- <article class="story" data-story-id="100000005314050" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5490
- <h2 class="story-heading">
5491
- <a href="https://www.nytimes.com/2017/08/29/dining/opentable-restaurant-reservations.html">
5492
- OpenTable Began a Revolution. Now It’s a Power Under Siege. </a>
5493
- </h2>
5494
- </article>
5495
- </li>
5496
- </ul>
5497
- </section>
5498
-
5499
- </div> <!-- close column -->
5500
-
5501
-
5502
- <div class="column last-column">
5503
-
5504
- <section>
5505
- <h2 class="section-heading">
5506
- <a href="https://www.nytimes.com/pages/opinion/index.html#sundayreview">Sunday Review &raquo;</a>
5507
- </h2>
5508
- <ul>
5509
- <li>
5510
- <article class="story theme-summary" data-story-id="100000005391244" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5511
-
5512
- <a class="story-link" href="https://www.nytimes.com/interactive/2017/08/25/opinion/sunday/worst-and-best-places-to-be-gay.html">
5513
-
5514
- <div class="thumb">
5515
- <img src="https://static01.nyt.com/images/2017/08/24/opinion/sunday/worst-and-best-places-to-be-gay-1503633763145/worst-and-best-places-to-be-gay-1503633763145-thumbStandard.png" alt="" />
5516
- </div>
5517
-
5518
- <h3 class="story-heading">
5519
- Op-Ed Columnist: The Worst (and Best) Places to Be Gay in America </h3>
5520
- </a>
5521
- </article>
5522
- </li>
5523
- <li>
5524
- <article class="story" data-story-id="100000005392272" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5525
- <h2 class="story-heading">
5526
- <a href="https://www.nytimes.com/2017/08/26/opinion/sunday/memorize-poems-poetry-education.html">
5527
- Molly Worthen: Memorize That Poem! </a>
5528
- </h2>
5529
- </article>
5530
- </li>
5531
- <li>
5532
- <article class="story" data-story-id="100000005388249" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5533
- <h2 class="story-heading">
5534
- <a href="https://www.nytimes.com/2017/08/26/opinion/sunday/obamacare-universal-health-coverage.html">
5535
- Editorial: Looking Beyond the Obamacare Debate to Improve Health Care </a>
5536
- </h2>
5537
- </article>
5538
- </li>
5539
- </ul>
5540
- </section>
5541
-
5542
- </div> <!-- close column -->
5543
-
5544
-
5545
- </div><!-- close split-3-layout -->
5546
-
5547
-
5548
- <div class="split-3-layout layout theme-base">
5549
-
5550
-
5551
- <div class="column ">
5552
-
5553
- <section>
5554
- <h2 class="section-heading">
5555
- <a href="https://www.nytimes.com/pages/realestate/index.html">Real Estate &raquo;</a>
5556
- </h2>
5557
- <ul>
5558
- <li>
5559
- <article class="story theme-summary" data-story-id="100000005386638" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5560
-
5561
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/realestate/weston-conn-quiet-and-wooded-with-top-notch-schools.html">
5562
-
5563
- <div class="thumb">
5564
- <img src="https://static01.nyt.com/images/2017/09/03/realestate/03LIVING-WESTON-slide-537E/03LIVING-WESTON-slide-537E-thumbStandard.jpg" alt="" />
5565
- </div>
5566
-
5567
- <h3 class="story-heading">
5568
- Living In: Weston, Conn.: Quiet and Wooded, With Top-Notch Schools </h3>
5569
- </a>
5570
- </article>
5571
- </li>
5572
- <li>
5573
- <article class="story" data-story-id="100000005390514" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5574
- <h2 class="story-heading">
5575
- <a href="https://www.nytimes.com/2017/08/30/realestate/house-hunting-in-bali.html">
5576
- International Real Estate: House Hunting in ... Bali </a>
5577
- </h2>
5578
- </article>
5579
- </li>
5580
- <li>
5581
- <article class="story" data-story-id="100000005395929" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5582
- <h2 class="story-heading">
5583
- <a href="https://www.nytimes.com/2017/08/30/realestate/900000-homes-in-colorado-pennsylvania-and-vermont.html">
5584
- What You Get: $900,000 Homes in Colorado, Pennsylvania and Vermont </a>
5585
- </h2>
5586
- </article>
5587
- </li>
5588
- </ul>
5589
- </section>
5590
-
5591
- </div> <!-- close column -->
5592
-
5593
-
5594
- <div class="column ">
5595
-
5596
- <section>
5597
- <h2 class="section-heading">
5598
- <a href="https://www.nytimes.com/section/upshot">The Upshot &raquo;</a>
5599
- </h2>
5600
- <ul>
5601
- <li>
5602
- <article class="story theme-summary" data-story-id="100000005396126" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5603
-
5604
- <a class="story-link" href="https://www.nytimes.com/interactive/2017/08/29/upshot/statues-quiz.html">
5605
-
5606
- <div class="thumb">
5607
- <img src="https://static01.nyt.com/images/2017/08/26/upshot/up-statue-Lee/up-statue-Lee-thumbStandard.jpg" alt="" />
5608
- </div>
5609
-
5610
- <h3 class="story-heading">
5611
- Which Statues Need to Come Down? You Decide </h3>
5612
- </a>
5613
- </article>
5614
- </li>
5615
- <li>
5616
- <article class="story" data-story-id="100000005393332" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5617
- <h2 class="story-heading">
5618
- <a href="https://www.nytimes.com/interactive/2017/08/29/upshot/harvey-rainfall-where-you-live.html">
5619
- Houston May Get 50 Inches of Rain. How Long Does It Take Your City to Get That Much? </a>
5620
- </h2>
5621
- </article>
5622
- </li>
5623
- <li>
5624
- <article class="story" data-story-id="100000005395922" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5625
- <h2 class="story-heading">
5626
- <a href="https://www.nytimes.com/2017/08/28/upshot/markets-are-signaling-that-hurricane-harvey-wont-crush-the-economy.html">
5627
- Pricing a Disaster: Markets Are Signaling That Hurricane Harvey Won’t Crush the Economy </a>
5628
- </h2>
5629
- </article>
5630
- </li>
5631
- </ul>
5632
- </section>
5633
-
5634
- </div> <!-- close column -->
5635
-
5636
-
5637
- <div class="column last-column">
5638
-
5639
- <section>
5640
- <h2 class="section-heading">
5641
- <a href="https://www.nytimes.com/section/magazine">Magazine &raquo;</a>
5642
- </h2>
5643
- <ul>
5644
- <li>
5645
- <article class="story theme-summary" data-story-id="100000005393258" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5646
-
5647
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/magazine/how-to-get-rich-in-trumps-washington.html">
5648
-
5649
- <div class="thumb">
5650
- <img src="https://static01.nyt.com/images/2017/09/03/magazine/03lobbyists1/03lobbyists1-thumbStandard.jpg" alt="" />
5651
- </div>
5652
-
5653
- <h3 class="story-heading">
5654
- Feature: How to Get Rich in Trump’s Washington </h3>
5655
- </a>
5656
- </article>
5657
- </li>
5658
- <li>
5659
- <article class="story" data-story-id="100000005381661" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5660
- <h2 class="story-heading">
5661
- <a href="https://www.nytimes.com/interactive/2017/08/24/magazine/usopen-federer-nadal-backhand-wonder-year.html">
5662
- U.S. Open: How Roger Federer Upgraded His Game </a>
5663
- </h2>
5664
- </article>
5665
- </li>
5666
- <li>
5667
- <article class="story" data-story-id="100000005389041" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5668
- <h2 class="story-heading">
5669
- <a href="https://www.nytimes.com/2017/08/30/magazine/my-nanny-has-a-gambling-problem-can-i-fire-her.html">
5670
- The Ethicist: My Nanny Has a Gambling Problem. Can I Fire Her? </a>
5671
- </h2>
5672
- </article>
5673
- </li>
5674
- </ul>
5675
- </section>
5676
-
5677
- </div> <!-- close column -->
5678
-
5679
-
5680
- </div><!-- close split-3-layout -->
5681
-
5682
-
5683
- <div class="split-3-layout layout theme-base">
5684
-
5685
-
5686
- <div class="column ">
5687
-
5688
- <section>
5689
- <h2 class="section-heading">
5690
- <a href="https://www.nytimes.com/pages/automobiles/index.html">Automobiles &raquo;</a>
5691
- </h2>
5692
- <ul>
5693
- <li>
5694
- <article class="story theme-summary" data-story-id="100000005398865" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5695
-
5696
- <a class="story-link" href="https://www.nytimes.com/2017/08/29/business/ford-driverless-pizza-delivery-dominos.html">
5697
-
5698
- <div class="thumb">
5699
- <img src="https://static01.nyt.com/images/2017/08/30/business/30FORD1/30FORD1-thumbStandard.jpg" alt="" />
5700
- </div>
5701
-
5702
- <h3 class="story-heading">
5703
- There’s a Pizza Delivery in Ford’s Future, by Driverless Car </h3>
5704
- </a>
5705
- </article>
5706
- </li>
5707
- <li>
5708
- <article class="story" data-story-id="100000005385761" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5709
- <h2 class="story-heading">
5710
- <a href="https://www.nytimes.com/2017/08/24/automobiles/wheels/pebble-beach-concours-delegance-car-auction.html">
5711
- Wheels: Bidding Before California Car Show Suggests Collectible Market Is Healthy </a>
5712
- </h2>
5713
- </article>
5714
- </li>
5715
- <li>
5716
- <article class="story" data-story-id="100000005391881" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5717
- <h2 class="story-heading">
5718
- <a href="https://www.nytimes.com/2017/08/25/business/volkswagen-engineer-prison-diesel-cheating.html">
5719
- Volkswagen Engineer Gets Prison in Diesel Cheating Case </a>
5720
- </h2>
5721
- </article>
5722
- </li>
5723
- </ul>
5724
- </section>
5725
-
5726
- </div> <!-- close column -->
5727
-
5728
-
5729
- <div class="column ">
5730
-
5731
- <section>
5732
- <h2 class="section-heading">
5733
- <a href="https://www.nytimes.com/section/t-magazine">T Magazine &raquo;</a>
5734
- </h2>
5735
- <ul>
5736
- <li>
5737
- <article class="story theme-summary" data-story-id="100000005365534" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5738
-
5739
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/t-magazine/travel/sullivan-county-narrowsburg-livingston-manor-callicoon-guide.html">
5740
-
5741
- <div class="thumb">
5742
- <img src="https://static01.nyt.com/images/2017/08/30/t-magazine/sullivan-slide-VBE5-copy/sullivan-slide-VBE5-thumbStandard.jpg" alt="" />
5743
- </div>
5744
-
5745
- <h3 class="story-heading">
5746
- Wanderlust: What to Do (and Where to Stay) in the Western Catskills </h3>
5747
- </a>
5748
- </article>
5749
- </li>
5750
- <li>
5751
- <article class="story" data-story-id="100000005392498" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5752
- <h2 class="story-heading">
5753
- <a href="https://www.nytimes.com/2017/08/29/t-magazine/charlottesville-art-robert-longo-toyin-ojih-odutola-sanford-biggers.html">
5754
- T Agitprop: 5 Artists Respond to: Charlottesville </a>
5755
- </h2>
5756
- </article>
5757
- </li>
5758
- <li>
5759
- <article class="story" data-story-id="100000005397209" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5760
- <h2 class="story-heading">
5761
- <a href="https://www.nytimes.com/2017/08/29/t-magazine/fashion/maggie-marilyn-hewitt-clothing-designer.html">
5762
- On the Verge: Person to Know: A Nonconformist New Zealand Designer </a>
5763
- </h2>
5764
- </article>
5765
- </li>
5766
- </ul>
5767
- </section>
5768
-
5769
- </div> <!-- close column -->
5770
-
5771
-
5772
- <div class="column last-column">
5773
-
5774
- <section>
5775
- <h2 class="section-heading">
5776
- <a href="https://www.nytimes.com/section/insider">Times Insider &raquo;</a>
5777
- </h2>
5778
- <ul>
5779
- <li>
5780
- <article class="story theme-summary" data-story-id="100000005400594" data-rank="0" data-collection-renderstyle="HpHedThumbWell">
5781
-
5782
- <a class="story-link" href="https://www.nytimes.com/2017/08/30/insider/events/game-of-thrones-conference-call-new-york-times.html">
5783
-
5784
- <div class="thumb">
5785
- <img src="https://static01.nyt.com/images/2017/08/30/insider/30insider-event-thrones-image/30insider-event-thrones-image-thumbStandard.jpg" alt="" />
5786
- </div>
5787
-
5788
- <h3 class="story-heading">
5789
- Conference Call, Sept. 6: Live Event: Discuss ‘Game of Thrones’ With The New York Times </h3>
5790
- </a>
5791
- </article>
5792
- </li>
5793
- <li>
5794
- <article class="story" data-story-id="100000005399053" data-rank="1" data-collection-renderstyle="HpHedThumbWell">
5795
- <h2 class="story-heading">
5796
- <a href="https://www.nytimes.com/2017/08/30/insider/the-sodden-haunted-fields-of-flanders.html">
5797
- Picturing the First World War: The Sodden, Haunted Fields of Flanders </a>
5798
- </h2>
5799
- </article>
5800
- </li>
5801
- <li>
5802
- <article class="story" data-story-id="100000005396519" data-rank="2" data-collection-renderstyle="HpHedThumbWell">
5803
- <h2 class="story-heading">
5804
- <a href="https://www.nytimes.com/2017/08/30/insider/newsbook-column-explainer-book-review.html">
5805
- When the News Begs for a Book: Behind the Newsbook Column </a>
5806
- </h2>
5807
- </article>
5808
- </li>
5809
- </ul>
5810
- </section>
5811
-
5812
- </div> <!-- close column -->
5813
-
5814
-
5815
- </div><!-- close split-3-layout -->
5816
-
5817
- </div>
5818
- </section><!-- close well section -->
5819
-
5820
- </div><!-- close ab-column -->
5821
-
5822
- <div class="c-column column">
5823
-
5824
-
5825
- <section class="real-estate">
5826
- <div class="layout split-layout theme-base">
5827
- <div class="column">
5828
- <div class="region real-estate-left-region">
5829
-
5830
- <div class="collection">
5831
- <h2 class="section-heading">
5832
- <a href="https://www.nytimes.com/section/realestate">Real Estate &raquo;</a>
5833
- </h2>
5834
- <article class="story theme-summary" id="topnews-100000005395929" data-story-id="100000005395929" data-rank="0" data-collection-renderstyle="HpSectionSumSmallMedia">
5835
-
5836
- <h3 class="kicker">What You Get </h3>
5837
-
5838
- <h2 class="story-heading"><a href="https://www.nytimes.com/2017/08/30/realestate/900000-homes-in-colorado-pennsylvania-and-vermont.html">$900,000 Homes in Colorado, Pennsylvania and Vermont</a></h2>
5839
-
5840
- <p class="byline">By TIM McKEOUGH </p>
5841
-
5842
- <div class="thumb">
5843
- <a href="https://www.nytimes.com/2017/08/30/realestate/900000-homes-in-colorado-pennsylvania-and-vermont.html"><img src="https://static01.nyt.com/images/2017/09/03/realestate/03WYG-slide-FF9B/03WYG-slide-FF9B-thumbStandard.jpg" alt=""></a>
5844
- </div>
5845
-
5846
- <p class="summary">
5847
- A renovated midcentury-modern home in Denver, a 1907 stone house in Philadelphia and a lakeside retreat in Ferrisburgh. </p>
5848
-
5849
-
5850
- </article>
5851
-
5852
- </div>
5853
- <div class="collection">
5854
- <ul class="theme-module-headlines">
5855
- <li><article class="story" data-collection-renderstyle="HpHeadline"><h2 class="story-heading"><a href="http://www.nytimes.com/real-estate/find-a-home">Search for Homes for Sale or Rent</a></h2></article></li>
5856
-
5857
- <li><article class="story" data-collection-renderstyle="HpHeadline"><h2 class="story-heading"><a href="https://www.nytimes.com/real-estate/mortgage-calculator">Mortgage Calculator</a></h2></article></li></ul>
5858
-
5859
- </div>
5860
-
5861
- </div><!-- close real-estate-left-region -->
5862
- </div>
5863
- <div class="column">
5864
- <div class="region real-estate-right-region">
5865
- <div class="collection">
5866
- <div id="HPmodule-RE2-alternate-content"><div></div>
5867
- <div class="collection">
5868
- </div></div></div>
5869
- <div id="hpmodulere2" class="ad hpmodulere2-ad nocontent robots-nocontent"></div>
5870
- </div><!-- close real-estate-right-region -->
5871
- </div>
5872
- </div>
5873
- </section>
5874
-
5875
-
5876
- <section id="recommendations" class="recommendations">
5877
- <div class="tabs-container">
5878
- <ul class="tabs">
5879
- <li data-type="most-emailed" class="most-emailed-tab"><a href="https://www.nytimes.com/trending/">Most Emailed</a></li><li data-type="most-viewed" class="most-viewed-tab"><a href="https://www.nytimes.com/gst/mostpopular.html">Most Viewed</a></li><li data-type="trending" class="trending-tab"><a href="http://www.nytimes.com/trending/">Trending</a></li><li data-type="recommended" class="recommended-tab"><a href="https://www.nytimes.com/recommendations">Recommended for you</a></li>
5880
- </ul>
5881
- </div><!-- end tabs-container -->
5882
-
5883
- <div class="tab-content most-emailed">
5884
- <div class="loader"></div>
5885
- </div>
5886
- <div class="tab-content most-viewed">
5887
- <div class="loader"></div>
5888
- </div>
5889
- <div class="tab-content trending">
5890
- <div class="loader"></div>
5891
- </div>
5892
- <div class="tab-content recommended">
5893
- <div class="loader"></div>
5894
- </div>
5895
-
5896
- <div id="recommendations-module-loader" class="loader-container">
5897
- <div class="loader loader-t-logo-32x32-ecedeb-ffffff"><span class="visually-hidden">Loading...</span></div>
5898
- </div>
5899
- </section>
5900
-
5901
- <div id="Box1" class="ad box1-ad nocontent robots-nocontent"></div>
5902
- <div id="HPBottom1" class="ad hpbottom1-ad nocontent robots-nocontent"></div>
5903
-
5904
- </div><!-- close c-column -->
5905
-
5906
- </div><!-- close span-ab-layout -->
5907
-
5908
- <div id="HPSponLink" class="ad hpsponlink-ad nocontent robots-nocontent"></div>
5909
- <div id="Bottom8" class="ad bottom8-ad nocontent robots-nocontent"></div>
5910
- <div id="Bottom9" class="ad bottom9-ad nocontent robots-nocontent"></div>
5911
- <div class="search-overlay"></div>
5912
- </main><!-- close main -->
5913
- <section id="site-index" class="site-index">
5914
- <header class="section-header">
5915
- <p class="user-action"><a href="https://www.nytimes.com/">Go to Home Page &raquo;</a></p>
5916
- <h2 class="section-heading">
5917
- <span class="visually-hidden">Site Index</span>
5918
- <a id="site-index-branding-link" href="https://www.nytimes.com/">
5919
- <span class="visually-hidden">The New York Times</span>
5920
- </a>
5921
- </h2>
5922
- <script>window.magnum.writeLogo('small', 'https://a1.nyt.com/assets/homepage/20170810-135137/images/foundation/logos/', '', '', 'standard', 'site-index-branding-link', '');</script>
5923
- </header>
5924
-
5925
- <nav id="site-index-navigation" class="site-index-navigation" role="navigation">
5926
- <h2 class="visually-hidden">Site Index Navigation</h2>
5927
- <div class="split-6-layout layout">
5928
-
5929
-
5930
- <div class="column">
5931
- <h3 class="menu-heading">News</h3>
5932
- <ul class="menu">
5933
-
5934
-
5935
- <li>
5936
- <a href="https://www.nytimes.com/pages/world/index.html">World</a>
5937
- </li>
5938
-
5939
-
5940
- <li>
5941
- <a href="https://www.nytimes.com/pages/national/index.html">U.S.</a>
5942
- </li>
5943
-
5944
-
5945
- <li>
5946
- <a href="https://www.nytimes.com/pages/politics/index.html">Politics</a>
5947
- </li>
5948
-
5949
-
5950
- <li>
5951
- <a href="https://www.nytimes.com/pages/nyregion/index.html">N.Y.</a>
5952
- </li>
5953
-
5954
-
5955
- <li>
5956
- <a href="https://www.nytimes.com/pages/business/index.html">Business</a>
5957
- </li>
5958
-
5959
-
5960
- <li>
5961
- <a href="https://www.nytimes.com/pages/technology/index.html">Tech</a>
5962
- </li>
5963
-
5964
-
5965
- <li>
5966
- <a href="https://www.nytimes.com/section/science">Science</a>
5967
- </li>
5968
-
5969
-
5970
- <li>
5971
- <a href="https://www.nytimes.com/pages/health/index.html">Health</a>
5972
- </li>
5973
-
5974
-
5975
- <li>
5976
- <a href="https://www.nytimes.com/pages/sports/index.html">Sports</a>
5977
- </li>
5978
-
5979
-
5980
- <li>
5981
- <a href="https://www.nytimes.com/pages/education/index.html">Education</a>
5982
- </li>
5983
-
5984
-
5985
- <li>
5986
- <a href="https://www.nytimes.com/pages/obituaries/index.html">Obituaries</a>
5987
- </li>
5988
-
5989
-
5990
- <li>
5991
- <a href="https://www.nytimes.com/pages/todayspaper/index.html">Today's Paper</a>
5992
- </li>
5993
-
5994
-
5995
- <li>
5996
- <a href="https://www.nytimes.com/pages/corrections/index.html">Corrections</a>
5997
- </li>
5998
-
5999
-
6000
- </ul>
6001
- </div><!-- close column -->
6002
-
6003
-
6004
- <div class="column">
6005
- <h3 class="menu-heading">Opinion</h3>
6006
- <ul class="menu">
6007
-
6008
-
6009
- <li>
6010
- <a href="https://www.nytimes.com/pages/opinion/index.html">Today's Opinion</a>
6011
- </li>
6012
-
6013
-
6014
- <li>
6015
- <a href="https://www.nytimes.com/pages/opinion/index.html#columnists">Op-Ed Columnists</a>
6016
- </li>
6017
-
6018
-
6019
- <li>
6020
- <a href="https://www.nytimes.com/pages/opinion/index.html#editorials">Editorials</a>
6021
- </li>
6022
-
6023
-
6024
- <li>
6025
- <a href="https://www.nytimes.com/pages/opinion/index.html#contributing">Contributing Writers</a>
6026
- </li>
6027
-
6028
-
6029
- <li>
6030
- <a href="https://www.nytimes.com/pages/opinion/index.html#op-ed">Op-Ed Contributors</a>
6031
- </li>
6032
-
6033
-
6034
- <li>
6035
- <a href="https://www.nytimes.com/pages/opinion/index.html#opinionator">Opinionator</a>
6036
- </li>
6037
-
6038
-
6039
- <li>
6040
- <a href="https://www.nytimes.com/pages/opinion/index.html#letters">Letters</a>
6041
- </li>
6042
-
6043
-
6044
- <li>
6045
- <a href="https://www.nytimes.com/pages/opinion/index.html#sundayreview">Sunday Review</a>
6046
- </li>
6047
-
6048
-
6049
- <li>
6050
- <a href="https://www.nytimes.com/pages/opinion/index.html#takingNote">Taking Note</a>
6051
- </li>
6052
-
6053
-
6054
- <li>
6055
- <a href="https://www.nytimes.com/roomfordebate">Room for Debate</a>
6056
- </li>
6057
-
6058
-
6059
- <li>
6060
- <a href="https://www.nytimes.com/video/opinion">Video: Opinion</a>
6061
- </li>
6062
-
6063
-
6064
- </ul>
6065
- </div><!-- close column -->
6066
-
6067
-
6068
- <div class="column">
6069
- <h3 class="menu-heading">Arts</h3>
6070
- <ul class="menu">
6071
-
6072
-
6073
- <li>
6074
- <a href="https://www.nytimes.com/pages/arts/index.html">Today's Arts</a>
6075
- </li>
6076
-
6077
-
6078
- <li>
6079
- <a href="https://www.nytimes.com/pages/arts/design/index.html">Art & Design</a>
6080
- </li>
6081
-
6082
-
6083
- <li>
6084
- <a href="https://www.nytimes.com/pages/books/index.html">Books</a>
6085
- </li>
6086
-
6087
-
6088
- <li>
6089
- <a href="https://www.nytimes.com/pages/arts/dance/index.html">Dance</a>
6090
- </li>
6091
-
6092
-
6093
- <li>
6094
- <a href="https://www.nytimes.com/pages/movies/index.html">Movies</a>
6095
- </li>
6096
-
6097
-
6098
- <li>
6099
- <a href="https://www.nytimes.com/pages/arts/music/index.html">Music</a>
6100
- </li>
6101
-
6102
-
6103
- <li>
6104
- <a href="https://www.nytimes.com/events/">N.Y.C. Events Guide</a>
6105
- </li>
6106
-
6107
-
6108
- <li>
6109
- <a href="https://www.nytimes.com/pages/arts/television/index.html">Television</a>
6110
- </li>
6111
-
6112
-
6113
- <li>
6114
- <a href="https://www.nytimes.com/pages/theater/index.html">Theater</a>
6115
- </li>
6116
-
6117
-
6118
- <li>
6119
- <a href="https://www.nytimes.com/video/arts">Video: Arts</a>
6120
- </li>
6121
-
6122
-
6123
- </ul>
6124
- </div><!-- close column -->
6125
-
6126
-
6127
- <div class="column">
6128
- <h3 class="menu-heading">Living</h3>
6129
- <ul class="menu">
6130
-
6131
-
6132
- <li>
6133
- <a href="https://www.nytimes.com/pages/automobiles/index.html">Automobiles</a>
6134
- </li>
6135
-
6136
-
6137
- <li>
6138
- <a href="https://www.nytimes.com/crosswords/">Crossword</a>
6139
- </li>
6140
-
6141
-
6142
- <li>
6143
- <a href="https://www.nytimes.com/pages/dining/index.html">Food</a>
6144
- </li>
6145
-
6146
-
6147
- <li>
6148
- <a href="https://www.nytimes.com/pages/education/index.html">Education</a>
6149
- </li>
6150
-
6151
-
6152
- <li>
6153
- <a href="https://www.nytimes.com/pages/fashion/index.html">Fashion & Style</a>
6154
- </li>
6155
-
6156
-
6157
- <li>
6158
- <a href="https://www.nytimes.com/pages/health/index.html">Health</a>
6159
- </li>
6160
-
6161
-
6162
- <li>
6163
- <a href="https://www.nytimes.com/section/jobs">Jobs</a>
6164
- </li>
6165
-
6166
-
6167
- <li>
6168
- <a href="https://www.nytimes.com/pages/magazine/index.html">Magazine</a>
6169
- </li>
6170
-
6171
-
6172
- <li>
6173
- <a href="https://www.nytimes.com/events/">N.Y.C. Events Guide</a>
6174
- </li>
6175
-
6176
-
6177
- <li>
6178
- <a href="https://www.nytimes.com/section/realestate">Real Estate</a>
6179
- </li>
6180
-
6181
-
6182
- <li>
6183
- <a href="https://www.nytimes.com/section/t-magazine">T Magazine</a>
6184
- </li>
6185
-
6186
-
6187
- <li>
6188
- <a href="https://www.nytimes.com/section/travel">Travel</a>
6189
- </li>
6190
-
6191
-
6192
- <li>
6193
- <a href="https://www.nytimes.com/pages/fashion/weddings/index.html">Weddings & Celebrations</a>
6194
- </li>
6195
-
6196
-
6197
- </ul>
6198
- </div><!-- close column -->
6199
-
6200
-
6201
- <div class="column">
6202
- <h3 class="menu-heading">Listings & More</h3>
6203
- <ul class="menu">
6204
-
6205
-
6206
- <li>
6207
- <a href="https://www.nytimes.com/section/reader-center">Reader Center</a>
6208
- </li>
6209
-
6210
-
6211
- <li>
6212
- <a href="https://www.nytimes.com/ref/classifieds/">Classifieds</a>
6213
- </li>
6214
-
6215
-
6216
- <li>
6217
- <a href="https://www.nytimes.com/marketing/tools-and-services/">Tools & Services</a>
6218
- </li>
6219
-
6220
-
6221
- <li>
6222
- <a href="https://www.nytimes.com/pages/topics/">Times Topics</a>
6223
- </li>
6224
-
6225
-
6226
- <li>
6227
- <a href="https://www.nytimes.com/events/">N.Y.C. Events Guide</a>
6228
- </li>
6229
-
6230
-
6231
- <li>
6232
- <a href="https://www.nytimes.com/interactive/blogs/directory.html">Blogs</a>
6233
- </li>
6234
-
6235
-
6236
- <li>
6237
- <a href="https://www.nytimes.com/pages/multimedia/index.html">Multimedia</a>
6238
- </li>
6239
-
6240
-
6241
- <li>
6242
- <a href="https://lens.blogs.nytimes.com/">Photography</a>
6243
- </li>
6244
-
6245
-
6246
- <li>
6247
- <a href="https://www.nytimes.com/video">Video</a>
6248
- </li>
6249
-
6250
-
6251
- <li>
6252
- <a href="https://www.nytimes.com/store/?&t=qry542&utm_source=nytimes&utm_medium=HPB&utm_content=hp_browsetree&utm_campaign=NYT-HP&module=SectionsNav&action=click&region=TopBar&version=BrowseTree&contentCollection=NYT%20Store&contentPlacement=2&pgtype=Homepage">NYT Store</a>
6253
- </li>
6254
-
6255
-
6256
- <li>
6257
- <a href="https://www.nytimes.com/times-journeys/?utm_source=nytimes&utm_medium=HPLink&utm_content=hp_browsetree&utm_campaign=NYT-HP">Times Journeys</a>
6258
- </li>
6259
-
6260
-
6261
- <li>
6262
- <a href="https://www.nytimes.com/seeallnav">Subscribe</a>
6263
- </li>
6264
-
6265
-
6266
- <li>
6267
- <a href="https://www.nytimes.com/membercenter">Manage My Account</a>
6268
- </li>
6269
-
6270
-
6271
- <li>
6272
- <a href="http://www.nytco.com">NYTCo</a>
6273
- </li>
6274
-
6275
-
6276
- </ul>
6277
- </div><!-- close column -->
6278
-
6279
-
6280
- <div class="column last-column">
6281
-
6282
- <h3 class="menu-heading">Subscribe</h3>
6283
-
6284
- <ul class="menu primary-menu">
6285
- <li class="menu-label">Subscribe</li>
6286
- <li class="home-delivery">
6287
- <i class="icon sprite-icon"></i>
6288
- <a class="nyt-home-delivery" href="https://www.nytimes.com/hdleftnav">Home Delivery</a>
6289
- </li>
6290
- <li class="digital-subscriptions">
6291
- <i class="icon sprite-icon"></i>
6292
- <a class="digital-subscription" href="https://www.nytimes.com/digitalleftnav">Digital Subscriptions</a>
6293
- </li>
6294
- <li class="nyt-crossword last-item">
6295
- <i class="icon sprite-icon"></i>
6296
- <a id="nyt-crossword" href="https://www.nytimes.com/crosswords/index.html">Crossword</a>
6297
- </li>
6298
- </ul>
6299
-
6300
- <ul class="menu secondary-menu">
6301
-
6302
- <li class="email-newsletters">
6303
- <a href="https://www.nytimes.com/marketing/newsletters">Email Newsletters</a>
6304
- </li>
6305
- <li>
6306
- <a href="https://myaccount.nytimes.com/mem/tnt.html">Alerts</a>
6307
- </li>
6308
- <li class="gift-subscription">
6309
- <a href="https://www.nytimes.com/giftleftnav">Gift Subscriptions</a>
6310
- </li>
6311
- <li>
6312
- <a href="https://www.nytimes.com/corporateleftnav">Corporate Subscriptions</a>
6313
- </li>
6314
- <li>
6315
- <a href="https://www.nytimes.com/educationleftnav">Education Rate</a>
6316
- </li>
6317
-
6318
- </ul>
6319
- <ul class="menu secondary-menu">
6320
- <li>
6321
- <a href="https://www.nytimes.com/services/mobile/index.html">Mobile Applications</a>
6322
- </li>
6323
- <li>
6324
- <a href="http://eedition.nytimes.com/cgi-bin/signup.cgi?cc=37FYY">Replica Edition</a>
6325
- </li>
6326
-
6327
- </ul>
6328
-
6329
- </div><!-- close column -->
6330
-
6331
- </div><!-- close split-6-layout -->
6332
-
6333
- </nav><!-- close nav -->
6334
-
6335
- </section><!-- close site-index -->
6336
-
6337
- <footer id="page-footer" class="page-footer" role="contentinfo">
6338
- <nav>
6339
- <h2 class="visually-hidden">Site Information Navigation</h2>
6340
- <ul>
6341
- <li>
6342
- <a href="https://www.nytimes.com/content/help/rights/copyright/copyright-notice.html" itemprop="copyrightNotice">
6343
- &copy; <span itemprop="copyrightYear">2017</span><span itemprop="copyrightHolder provider sourceOrganization" itemscope itemtype="http://schema.org/Organization" itemid="http://www.nytimes.com"><span itemprop="name"> The New York Times Company</span><meta itemprop="tickerSymbol" content="NYSE NYT"/></span>
6344
- </a>
6345
- </li>
6346
- <li class="wide-viewport-item"><a href="https://www.nytimes.com/ref/membercenter/help/infoservdirectory.html">Contact Us</a></li>
6347
- <li class="wide-viewport-item"><a href="http://www.nytco.com/careers">Work With Us</a></li>
6348
- <li class="wide-viewport-item"><a href="http://nytmediakit.com/">Advertise</a></li>
6349
- <li class="wide-viewport-item"><a href="https://www.nytimes.com/content/help/rights/privacy/policy/privacy-policy.html#pp">Your Ad Choices</a></li>
6350
- <li><a href="https://www.nytimes.com/privacy">Privacy</a></li>
6351
- <li><a href="https://www.nytimes.com/ref/membercenter/help/agree.html" itemprop="usageTerms">Terms of Service</a></li>
6352
- <li class="wide-viewport-item last-item"><a href="https://www.nytimes.com/content/help/rights/sale/terms-of-sale.html">Terms of Sale</a></li>
6353
- </ul>
6354
- </nav>
6355
- <nav class="last-nav">
6356
- <h2 class="visually-hidden">Site Information Navigation</h2>
6357
- <ul>
6358
- <li><a href="http://spiderbites.nytimes.com">Site Map</a></li>
6359
- <li><a href="https://www.nytimes.com/membercenter/sitehelp.html">Help</a></li>
6360
- <li><a href="https://myaccount.nytimes.com/membercenter/feedback.html">Site Feedback</a></li>
6361
- <li class="wide-viewport-item last-item"><a href="https://www.nytimes.com/subscriptions/Multiproduct/lp5558.html?campaignId=37WXW">Subscriptions</a></li>
6362
- </ul>
6363
- </nav>
6364
-
6365
- <div id="mobile-banner" class="mobile-banner hidden">
6366
- <a class="banner-message" href="https://mobile.nytimes.com/">View Mobile Version</a>
6367
- </div>
6368
-
6369
- <div id="dfp-perf-test" class="ad hidden"></div>
6370
- </footer>
6371
- </div><!-- close page -->
6372
- </div><!-- close shell -->
6373
- <script>
6374
- require(['foundation/main'], function () {
6375
- require(['homepage/main']);
6376
- require(['jquery/nyt', 'foundation/views/page-manager'], function ($, pageManager) {
6377
- if (window.location.search.indexOf('disable_tagx') > 0) {
6378
- return;
6379
- }
6380
- $(document).ready(function () {
6381
- require(['https://a1.nyt.com/analytics/tagx-simple.min.js'], function () {
6382
- pageManager.trackingFireEventQueue();
6383
- });
6384
- });
6385
- });
6386
- });
6387
- </script>
6388
- <!--esi
6389
- <esi:include src="/appconfig/https/show-modal.js" />
6390
- -->
6391
-
6392
- <div id="Inv1" class="ad inv1-ad hidden"></div>
6393
- <div id="Inv2" class="ad inv2-ad hidden"></div>
6394
- <div id="Inv3" class="ad inv3-ad hidden"></div>
6395
- <div id="ab1" class="ad ab1-ad hidden"></div>
6396
- <div id="ab2" class="ad ab2-ad hidden"></div>
6397
- <div id="ab3" class="ad ab3-ad hidden"></div>
6398
- <div id="prop1" class="ad prop1-ad hidden"></div>
6399
- <div id="prop2" class="ad prop2-ad hidden"></div>
6400
- <div id="Anchor" class="ad anchor-ad hidden"></div>
6401
- <div id="ADX_CLIENTSIDE" class="ad adx-clientside-ad hidden"></div>
6402
- </body>
6403
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/masterminds/html5/test/benchmark/run.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
-
3
- require __DIR__ . '/../../vendor/autoload.php';
4
-
5
- $iterations = isset($argv[1]) ? $argv[1] : 100;
6
-
7
- $html5 = new Masterminds\HTML5();
8
- $content = file_get_contents(__DIR__ . '/example.html');
9
- $dom = $html5->loadHTML($content);
10
-
11
- $samples = array();
12
- for ($i = 0; $i < $iterations; ++$i) {
13
- $t = microtime(true);
14
- $dom = $html5->loadHTML($content);
15
- $samples[] = microtime(true) - $t;
16
- }
17
- $time = array_sum($samples) / count($samples);
18
- echo 'Loading: ' . ($time * 1000) . "\n";
19
-
20
- $samples = array();
21
- for ($i = 0; $i < $iterations; ++$i) {
22
- $t = microtime(true);
23
- $html5->saveHTML($dom);
24
- $samples[] = microtime(true) - $t;
25
- }
26
- $time = array_sum($samples) / count($samples);
27
- echo 'Writing: ' . ($time * 1000) . "\n";
28
-
29
- exit(0);