Merge branch 'master' of git@gitorious.org:statusnet/mainline

This commit is contained in:
Zach Copley 2010-05-28 06:24:39 +00:00
commit 429219f9ec
1 changed files with 13 additions and 5 deletions

View File

@ -205,12 +205,20 @@ function _mdomain($backtrace)
if (DIRECTORY_SEPARATOR !== '/') {
$path = strtr($path, DIRECTORY_SEPARATOR, '/');
}
$cut = strpos($path, '/plugins/') + 9;
$cut2 = strpos($path, '/', $cut);
if ($cut && $cut2) {
$cached[$path] = substr($path, $cut, $cut2 - $cut);
} else {
$plug = strpos($path, '/plugins/');
if ($plug === false) {
// We're not in a plugin; return null for the default domain.
return null;
} else {
$cut = $plug + 9;
$cut2 = strpos($path, '/', $cut);
if ($cut2) {
$cached[$path] = substr($path, $cut, $cut2 - $cut);
} else {
// We might be running directly from the plugins dir?
// If so, there's no place to store locale info.
return null;
}
}
}
return $cached[$path];