fixed PHP notices

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50831 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-03-11 00:39:44 +00:00
parent bba9bb623e
commit ed520fe9df

View File

@ -938,10 +938,12 @@ class i18n extends Controller {
} else {
global $_CLASS_MANIFEST;
if(strpos($name,'_') !== false) $name = strtok($name,'_');
$path = str_replace('\\','/',Director::makeRelative($_CLASS_MANIFEST[$name]));
ereg('/([^/]+)/', $path, $module);
if(isset($_CLASS_MANIFEST[$name])) {
$path = str_replace('\\','/',Director::makeRelative($_CLASS_MANIFEST[$name]));
ereg('/([^/]+)/', $path, $module);
}
}
return ($module) ? $module[1] : false;
return (isset($module)) ? $module[1] : false;
}