summaryrefslogtreecommitdiff
path: root/lib/language.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-05-27 14:54:43 -0700
committerBrion Vibber <brion@pobox.com>2010-05-27 14:54:43 -0700
commit2f2fa100715f9c09b2b91a2d1afddacf7b7f16db (patch)
tree883a6642614484db322a3b6f17511c2ab5f46376 /lib/language.php
parent87b8a89aa7b96e63586bdd3b1afb9d43355fd48b (diff)
parent2b318a3420fe3e979defc7eacfb1eb2d9321d807 (diff)
Merge branch 'master' of gitorious.org:statusnet/mainline into testingtesting
Diffstat (limited to 'lib/language.php')
-rw-r--r--lib/language.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/language.php b/lib/language.php
index 64b59e739..3846b8f35 100644
--- a/lib/language.php
+++ b/lib/language.php
@@ -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];