Changeset 3841441
- Timestamp:
- 12/03/2026 01:46:16 AM (9 hours ago)
- Location:
- microsoft-clarity/trunk
- Files:
-
- 3 edited
-
clarity.php (modified) (1 diff)
-
includes/brandagent-endpoint.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
microsoft-clarity/trunk/clarity.php
r3836356 r3841441 5 5 * Plugin URI: https://clarity.microsoft.com/ 6 6 * Description: With data and session replay from Clarity, you'll see how people are using your site — where they get stuck and what they love. 7 * Version: 0.10. 397 * Version: 0.10.40 8 8 * Author: Microsoft 9 9 * Author URI: https://www.microsoft.com/en-us/ -
microsoft-clarity/trunk/includes/brandagent-endpoint.php
r3795429 r3841441 472 472 } 473 473 474 // Restrict to an explicit allowlist so a caller cannot pull private or PII-bearing 475 // custom post types through WP_Query. Sites can widen it via the filter. 476 $allowed_types = apply_filters( 'brandagent_content_fetch_allowed_post_types', array( 'post', 'page' ) ); 477 $requested_types = ( isset( $req['types'] ) && is_array( $req['types'] ) ) 478 ? array_values( array_map( 'sanitize_key', $req['types'] ) ) 479 : array(); 480 $types = array_values( array_intersect( $requested_types, $allowed_types ) ); 481 if ( empty( $types ) ) { 482 $types = $allowed_types; 483 } 484 $page = isset( $req['page'] ) ? max( 1, intval( $req['page'] ) ) : 1; 485 $per_page = isset( $req['per_page'] ) ? min( 100, max( 1, intval( $req['per_page'] ) ) ) : 50; 486 487 $query = new WP_Query( array( 488 'post_type' => $types, 489 'post_status' => 'publish', 490 'posts_per_page' => $per_page, 491 'paged' => $page, 492 'orderby' => 'ID', 493 'order' => 'ASC', 494 'ignore_sticky_posts' => true, 495 'has_password' => false, 496 ) ); 497 498 $items = array(); 499 foreach ( $query->posts as $post ) { 500 // Shared builder (includes/brandagent-content-webhooks.php) — the single source of truth for 501 // the content item shape, so the bulk fetch here and the incremental webhooks stay identical. 502 $items[] = brandagent_build_content_item( $post ); 474 // Contain incidental filter output without changing the HTML returned as content_text. 475 // Discard in chunks so a large CSS prefix is not retained until the whole batch completes. 476 $output_buffer_level = ob_get_level(); 477 $output_buffer_closed = false; 478 if ( ! ob_start( static function ( $output, $phase ) use ( &$output_buffer_closed ) { 479 if ( $phase & PHP_OUTPUT_HANDLER_FINAL ) { 480 $output_buffer_closed = true; 481 } 482 return ''; 483 }, 8192 ) ) { 484 throw new RuntimeException( 'Unable to isolate WordPress content export output.' ); 485 } 486 try { 487 // Restrict to an explicit allowlist so a caller cannot pull private or PII-bearing 488 // custom post types through WP_Query. Sites can widen it via the filter. 489 $allowed_types = apply_filters( 'brandagent_content_fetch_allowed_post_types', array( 'post', 'page' ) ); 490 $requested_types = ( isset( $req['types'] ) && is_array( $req['types'] ) ) 491 ? array_values( array_map( 'sanitize_key', $req['types'] ) ) 492 : array(); 493 $types = array_values( array_intersect( $requested_types, $allowed_types ) ); 494 if ( empty( $types ) ) { 495 $types = $allowed_types; 496 } 497 $page = isset( $req['page'] ) ? max( 1, intval( $req['page'] ) ) : 1; 498 $per_page = isset( $req['per_page'] ) ? min( 100, max( 1, intval( $req['per_page'] ) ) ) : 50; 499 500 if ( $output_buffer_closed ) { 501 throw new RuntimeException( 'WordPress content export output isolation was interrupted.' ); 502 } 503 $query = new WP_Query( array( 504 'post_type' => $types, 505 'post_status' => 'publish', 506 'posts_per_page' => $per_page, 507 'paged' => $page, 508 'orderby' => 'ID', 509 'order' => 'ASC', 510 'ignore_sticky_posts' => true, 511 'has_password' => false, 512 ) ); 513 514 $items = array(); 515 foreach ( $query->posts as $post ) { 516 if ( $output_buffer_closed ) { 517 throw new RuntimeException( 'WordPress content export output isolation was interrupted.' ); 518 } 519 // Shared builder (includes/brandagent-content-webhooks.php) — the single source of truth for 520 // the content item shape, so the bulk fetch here and the incremental webhooks stay identical. 521 $items[] = brandagent_build_content_item( $post ); 522 } 523 if ( $output_buffer_closed ) { 524 throw new RuntimeException( 'WordPress content export output isolation was interrupted.' ); 525 } 526 } finally { 527 while ( ob_get_level() > $output_buffer_level ) { 528 if ( ! ob_end_clean() ) { 529 throw new RuntimeException( 'Unable to restore WordPress content export output buffers.' ); 530 } 531 } 503 532 } 504 533 -
microsoft-clarity/trunk/readme.txt
r3836356 r3841441 4 4 Requires at least: 4.0 5 5 Tested up to: 7.0 6 Stable tag: 0.10. 396 Stable tag: 0.10.40 7 7 License: MIT 8 8 License URI: https://docs.opensource.microsoft.com/content/releasing/license.html … … 95 95 96 96 == Changelog == 97 = 0.10.40 = 98 * Bugfix. 99 97 100 = 0.10.39 = 98 101 * Bugfix.
Note:
See TracChangeset
for help on using the changeset viewer.