Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 0 additions & 10 deletions .dev-lib

This file was deleted.

21 changes: 0 additions & 21 deletions .editorconfig

This file was deleted.

11 changes: 0 additions & 11 deletions .gitattributes

This file was deleted.

28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

46 changes: 0 additions & 46 deletions bin/install-pre-commit-hook.sh

This file was deleted.

17 changes: 0 additions & 17 deletions bin/pre-commit

This file was deleted.

27 changes: 0 additions & 27 deletions bin/travis.sh

This file was deleted.

17 changes: 12 additions & 5 deletions lib/api/utilities/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,24 @@ function beans_url_to_path( $url, $force_rebuild = false ) {
$blogdetails = '';
}

// It's not an internal URL. Bail out.
if ( false === stripos( parse_url( $url, PHP_URL_HOST ), parse_url( $site_url, PHP_URL_HOST ) ) ) {
if ( false === stripos( $url, parse_url( site_url(), PHP_URL_SCHEME ) ) ) {
// If no url scheme found, it's local path instead of url.
// Also path is actually relative path instead of absolute.
// Add ./ in front of the relative url to make it relative path.
// After sanitize it will be converted to absolute path.
$url = beans_sanitize_path( './' . $url );
}
return $url;
}

// Fix protocol. It isn't needed to set SSL as it is only used to parse the URL.
if ( ! parse_url( $url, PHP_URL_SCHEME ) ) {
$original_url = $url;
$url = 'http://' . ltrim( $url, '/' );
}

// It's not an internal URL. Bail out.
if ( false === stripos( parse_url( $url, PHP_URL_HOST ), parse_url( $site_url, PHP_URL_HOST ) ) ) {
return isset( $original_url ) ? $original_url : $url;
}

// Parse url and standardize backslashes.
$url = parse_url( $url, PHP_URL_PATH );
$path = wp_normalize_path( $url );
Expand Down
73 changes: 0 additions & 73 deletions phpcs.xml.dist

This file was deleted.

29 changes: 0 additions & 29 deletions phpunit.xml.dist

This file was deleted.

Loading