Skip to content

Commit

Permalink
format a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Peng Chen committed Feb 24, 2023
1 parent 701d9d9 commit c975aa2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions trunk/includes/pardot-plugin-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -965,22 +965,21 @@ static function convert_embed_code_https($embed_code)
preg_match_all($reg_exUrl, $embed_code, $urls);

// Check if default domain is already HTTPS
$reg_exUrlHttpOnly = "/(http)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,63}(\/\S[^'\"]*)?/";
$reg_exUrl_http_only = "/(http)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,63}(\/\S[^'\"]*)?/";
foreach ($urls[0] as $url) {
/**
* If the URL does not use HTTPS, replace it with the approved Pardot HTTPS URL
*/
if (strcasecmp(substr($url, 0, 8), "https://")) {
$urlpieces = parse_url($url);
$httpsurl = 'https://go.' . Pardot_Settings::BASE_PARDOT_DOMAIN . $urlpieces['path'];
$embed_code = preg_replace($reg_exUrlHttpOnly, $httpsurl, $embed_code, 1);
$embed_code = preg_replace($reg_exUrl_http_only, $httpsurl, $embed_code, 1);
}
}
}
return $embed_code;
}


/**
* Grab the HTML for the Pardot Dynamic Content to be displayed via a widget or via a shortcode.
*
Expand Down

0 comments on commit c975aa2

Please sign in to comment.