Skip to content

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed May 31, 2023
1 parent 188ce66 commit 7135cb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public function validate_feed_catch_all( $catch_all ) {

public function extract_tags( $item, User_Feed $feed = null, User $friend_user = null ) {
// This is a variation of the ACTIVITYPUB_HASHTAGS_REGEXP.
if ( \preg_match_all( '/(?:(?<=\s)|(?<=<p>)|(?<=<br\s*/?>)|^)#(\w+)(?:(?=\s|[[:punct:]]|$))/ui', \wp_strip_all_tags( $item->post_content ), $match ) ) {
if ( \preg_match_all( '/(?:(?<=\s)|(?<=<p>)|(?<=<br>)|^)#(\w+)(?:(?=\s|[[:punct:]]|$))/ui', \wp_strip_all_tags( $item->post_content ), $match ) ) {
$tags = \implode( ', ', $match[1] );
$item->tags = $tags;
}
Expand Down

0 comments on commit 7135cb6

Please sign in to comment.