Skip to content

Commit

Permalink
Assume https as default
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Mar 23, 2023
1 parent f0fa1b4 commit 9bae3b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lhc_web/lib/core/lhbbcode/lhbbcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ public static function esc_url( $url, $protocols = null, $_context = 'display' )
}
$url = str_replace(';//', '://', $url);
/* If the URL doesn't appear to contain a scheme, we
* presume it needs http:// prepended (unless a relative
* presume it needs https:// prepended (unless a relative
* link starting with /, # or ? or a php file).
*/
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
$url = 'http://' . $url;
$url = 'https://' . $url;
// Replace ampersands and single quotes only when displaying.
if ( 'display' == $_context ) {
$url = self::wp_kses_normalize_entities( $url );
Expand Down Expand Up @@ -722,7 +722,7 @@ public static function _make_url_embed($matches){
public static function _make_web_ftp_clickable_cb( $matches ) {
$ret = '';
$dest = $matches[2];
$dest = 'http://' . $dest;
$dest = 'https://' . $dest;
// removed trailing [.,;:)] from URL
if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
$ret = substr($dest, -1);
Expand Down
6 changes: 3 additions & 3 deletions lhc_web/lib/core/lhbbcode/lhbbcode_cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ public static function esc_url( $url, $protocols = null, $_context = 'display' )
}
$url = str_replace(';//', '://', $url);
/* If the URL doesn't appear to contain a scheme, we
* presume it needs http:// prepended (unless a relative
* presume it needs https:// prepended (unless a relative
* link starting with /, # or ? or a php file).
*/
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
$url = 'http://' . $url;
$url = 'https://' . $url;
// Replace ampersands and single quotes only when displaying.
if ( 'display' == $_context ) {
$url = self::wp_kses_normalize_entities( $url );
Expand Down Expand Up @@ -711,7 +711,7 @@ public static function _make_url_embed($matches){
public static function _make_web_ftp_clickable_cb( $matches ) {
$ret = '';
$dest = $matches[2];
$dest = 'http://' . $dest;
$dest = 'https://' . $dest;
// removed trailing [.,;:)] from URL
if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
$ret = substr($dest, -1);
Expand Down

0 comments on commit 9bae3b7

Please sign in to comment.