function ARC_rdfxml_parser::get_clean_base in Taxonomy import/export via XML 6.2
Same name and namespace in other branches
- 5.2 arc/ARC_rdfxml_parser.php \ARC_rdfxml_parser::get_clean_base()
- 5 arc/ARC_rdfxml_parser.php \ARC_rdfxml_parser::get_clean_base()
- 6 arc/ARC_rdfxml_parser.php \ARC_rdfxml_parser::get_clean_base()
2 calls to ARC_rdfxml_parser::get_clean_base()
File
- arc/
ARC_rdfxml_parser.php, line 200
Class
Code
function get_clean_base($base = "") {
/* remove fragment */
if (preg_match("/([^#]*)[#]?/", $base, $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)) {
/* //+something */
if (strpos($matches[1], "/") === false) {
/* no more slashes */
$base .= "/";
}
}
return $base;
}