Changeset 52132 for trunk/tests/phpunit/tests/oembed/getResponseData.php
- Timestamp:
- 11/11/2021 02:47:10 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/oembed/getResponseData.php
r52010 r52132 11 11 // `get_post_embed_html()` assumes `wp-includes/js/wp-embed.js` is present: 12 12 self::touch( ABSPATH . WPINC . '/js/wp-embed.js' ); 13 } 14 15 private function normalize_secret_attribute( $data ) { 16 if ( is_array( $data ) ) { 17 $html = $data['html']; 18 } else { 19 $html = $data; 20 } 21 22 $html = preg_replace( '/secret=("?)\w+\1/', 'secret=__SECRET__', $html ); 23 24 if ( is_array( $data ) ) { 25 $data['html'] = $html; 26 } else { 27 $data = $html; 28 } 29 30 return $data; 13 31 } 14 32 … … 37 55 'width' => 400, 38 56 'height' => 225, 39 'html' => get_post_embed_html( 400, 225, $post),57 'html' => $this->normalize_secret_attribute( get_post_embed_html( 400, 225, $post ) ), 40 58 ), 41 $ data59 $this->normalize_secret_attribute( $data ) 42 60 ); 43 61 } … … 73 91 'width' => 400, 74 92 'height' => 225, 75 'html' => get_post_embed_html( 400, 225, $post),93 'html' => $this->normalize_secret_attribute( get_post_embed_html( 400, 225, $post ) ), 76 94 ), 77 $ data95 $this->normalize_secret_attribute( $data ) 78 96 ); 79 97 }
Note: See TracChangeset
for help on using the changeset viewer.