issue 160, fixed eval lang code

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9128 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-08 10:39:07 +00:00
parent 338b70f0b3
commit 662b3f0915

View file

@ -466,16 +466,21 @@ class Context {
if(!is_array($self->loaded_lang_files)) $self->loaded_lang_files = array();
if(in_array($filename, $self->loaded_lang_files)) return;
$self->loaded_lang_files[] = $filename;
if (is_readable($filename))
if ($filename && is_readable($filename)){
$self->loaded_lang_files[] = $filename;
@include($filename);
else
}else{
$self->_evalxmlLang($path);
}
}
function _evalxmlLang($path) {
global $lang;
$_path = 'eval://'.$path;
if(in_array($_path, $this->loaded_lang_files)) return;
if(substr($path,-1)!='/') $path .= '/';
$file = $path.'lang.xml';
@ -483,7 +488,10 @@ class Context {
$oXmlLangParser = new XmlLangParser($file, $this->lang_type);
$content = $oXmlLangParser->getCompileContent();
eval($content);
if ($content){
$this->loaded_lang_files[] = $_path;
eval($content);
}
}
function _loadXmlLang($path) {