function ARC_sparql_parser::get_url_base in Taxonomy import/export via XML 5
Same name and namespace in other branches
- 5.2 arc/ARC_sparql_parser.php \ARC_sparql_parser::get_url_base()
- 6.2 arc/ARC_sparql_parser.php \ARC_sparql_parser::get_url_base()
- 6 arc/ARC_sparql_parser.php \ARC_sparql_parser::get_url_base()
2 calls to ARC_sparql_parser::get_url_base()
File
- arc/
ARC_sparql_parser.php, line 139
Class
Code
function get_url_base($url = "") {
$base = $url;
/* remove fragment */
if (preg_match("/([^#]*)[#]?/", $url, $matches)) {
/* should always match, remove fragment */
$base = $matches[1];
}
/* no path, no query, no trailing slash, e.g. http://www.example.com -> add slash */
if (preg_match("/\\/\\/[^\\/]+\$/", $base, $matches)) {
/* //+no more slashes */
$base .= "/";
}
return $base;
}