Skip to content

Commit

Permalink
Content Options: Ensure excerpt_length is an int to prevent fatal err…
Browse files Browse the repository at this point in the history
…ors (#40389)

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12235362927

Upstream-Ref: Automattic/jetpack@2cb6523
  • Loading branch information
coder-karen authored and matticbot committed Dec 9, 2024
1 parent 2b17cd4 commit 17160b6
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 85 deletions.
58 changes: 29 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This is an alpha version! The changes listed here are not final.

### Fixed
- Content Options: Ensure excerpt_length is cast to an int if it is not already, to prevent fatal errors.
- Customizer: Fix spacing issue in Content Options

## [0.7.3] - 2024-12-04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ function jetpack_blog_display_custom_excerpt( $content = '' ) {
$text = wp_strip_all_tags( $text );
/** This filter is documented in wp-includes/formatting.php */
$excerpt_length = apply_filters( 'excerpt_length', 55 );
$excerpt_length = is_numeric( $excerpt_length ) ? (int) $excerpt_length : 55;

/** This filter is documented in wp-includes/formatting.php */
$excerpt_more = apply_filters( 'excerpt_more', ' [...]' );

Expand Down
Loading

0 comments on commit 17160b6

Please sign in to comment.