function backup_migrate_location_remote::glue_url in Backup and Migrate 8.3
Same name and namespace in other branches
- 6.3 includes/locations.inc \backup_migrate_location_remote::glue_url()
Glue a URLs component parts back into a URL.
Overrides backup_migrate_location::glue_url
2 calls to backup_migrate_location_remote::glue_url()
- backup_migrate_location_remote::edit_form_submit in includes/
locations.inc - Submit the configuration form. Glue the url together and add the old password back if a new one was not specified.
- backup_migrate_location_remote::url in includes/
locations.inc - Get a url from the parts.
File
- includes/
locations.inc, line 455
Class
- backup_migrate_location_remote
- A base class for creating locations.
Code
function glue_url($parts, $hide_password = TRUE) {
// Obscure the password if we need to.
$parts['pass'] = $hide_password ? "" : $parts['pass'];
// Assemble the URL.
$out = "";
$out .= $parts['scheme'] . '://';
$out .= $parts['user'] ? urlencode($parts['user']) : '';
$out .= $parts['user'] && $parts['pass'] ? ":" . urlencode($parts['pass']) : '';
$out .= $parts['user'] || $parts['pass'] ? "@" : "";
$out .= $parts['host'];
$out .= !empty($parts['port']) ? ':' . $parts['port'] : '';
$out .= "/" . $parts['path'];
return $out;
}