Making WordPress.org

Changeset 12623


Ignore:
Timestamp:
06/06/2023 05:31:31 AM (3 years ago)
Author:
dd32
Message:

Helpscout: Match plugin URLs when presented within HTML <a> tags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/common.php

    r12622 r12623  
    300300
    301301            // Extract matches from the email.
    302             $email_body = strip_tags( str_replace( '<br>', "\n", $thread->body ) );
     302            $email_text = strip_tags( str_replace( '<br>', "\n", $thread->body ) );
    303303
    304304            foreach ( $regexes as $regex ) {
    305                 if ( ! preg_match_all( $regex, $email_body, $m ) ) {
     305                if (
     306                    // Check the email text only
     307                    ! preg_match_all( $regex, $email_text, $m ) &&
     308                    // ..and the full email body, which may be HTML.
     309                    ! preg_match_all( $regex, $thread->body, $m )
     310                ) {
    306311                    continue;
    307312                }
Note: See TracChangeset for help on using the changeset viewer.