Skip to content

Instantly share code, notes, and snippets.

/-

Created November 29, 2017 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0d4ecd6d8d7b7c1f981ee9834c2352a6 to your computer and use it in GitHub Desktop.
Save anonymous/0d4ecd6d8d7b7c1f981ee9834c2352a6 to your computer and use it in GitHub Desktop.
diff --git a/src/bp-core/bp-core-template.php b/src/bp-core/bp-core-template.php
index 21825050f..6b558fe04 100644
--- a/src/bp-core/bp-core-template.php
+++ b/src/bp-core/bp-core-template.php
@@ -1017,7 +1017,7 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
$is_word_boundary = ' ' === $truncate[ $pos ];
if ( ! $is_word_boundary && isset( $truncate_tags[ $pos - 1 ] ) ) {
$preceding_tag = $truncate_tags[ $pos - 1 ];
- if ( ' ' === $truncate[ $preceding_tag['start'] - 1 ] ) {
+ if ( isset( $truncate[ $preceding_tag['start'] - 1 ] ) && ' ' === $truncate[ $preceding_tag['start'] - 1 ] ) {
$is_word_boundary = true;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment