protected function ClassifiedTestTestBasicTest::relativizeHref in Classified Ads 7.3
Convert a host-relative path like /drupal/taxonomy to a drupal path.
Parameters
string $href: Some path like "/drupal/taxonomy" or "/taxonomy".
Return value
string The internal still aliased path like "taxonomy", or "/" if path does not belong in the current site.
See also
test1265524()
1 call to ClassifiedTestTestBasicTest::relativizeHref()
- ClassifiedTestTestBasicTest::test1265524 in tests/
classified_test_basic.test - Bug 1265524: Can not edit taxonomy terms.
File
- tests/
classified_test_basic.test, line 215
Class
- ClassifiedTestTestBasicTest
- Basic test for known bugs in previous versions.
Code
protected function relativizeHref($href) {
$base = base_path();
if (strpos($href, $base) === 0) {
$ret = drupal_substr($href, drupal_strlen($base));
}
else {
$ret = '/';
}
return $ret;
}