function trans ($str) {
global $translations, $lang;
- $res = $translations[$lang][$str];
+ if (isset ($translations[$lang]) and isset($translations[$lang][$str])) {
+ $res = $translations[$lang][$str];
+ }
if (!isset ($res) || strlen ($res) == 0) {
return $str;
} else {
if ($val > 1.0) {
$val = 1.0;
}
- $possibilities [$matches [1]] = max ($val, $possibilities [$matches [1]]);
+ $ceil = (isset ($possibilities[$matches[1]]))? $possibilities[$matches[1]]: 0;
+ $possibilities [$matches [1]] = max ($val, $ceil);
}
}
arsort ($possibilities);