summaryrefslogtreecommitdiff
path: root/framework/I18N
diff options
context:
space:
mode:
authorxue <>2006-02-18 02:25:34 +0000
committerxue <>2006-02-18 02:25:34 +0000
commit8b9a5c2f0d5025e29a5477ea8cc8937db49b0341 (patch)
tree938ad05685a430d344e3bf1957f5d3ccd0d1e9ce /framework/I18N
parentcba0c1b472cec22e4ffed2b3b084bea27cd26582 (diff)
Fixed a security issue about usage of Prado::getPathOfNamespace.
Diffstat (limited to 'framework/I18N')
-rw-r--r--framework/I18N/TGlobalization.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index 1f568a27..317273ac 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -28,13 +28,13 @@ class TGlobalization extends TModule
{
/**
* Default character set is 'UTF-8'.
- * @var string
+ * @var string
*/
private $_defaultCharset = 'UTF-8';
/**
* Default culture is 'en'.
- * @var string
+ * @var string
*/
private $_defaultCulture = 'en';
@@ -46,13 +46,13 @@ class TGlobalization extends TModule
/**
* The current charset.
- * @var string
- */
+ * @var string
+ */
protected $_charset='UTF-8';
/**
* The current culture.
- * @var string
+ * @var string
*/
protected $_culture='en';
@@ -64,7 +64,7 @@ class TGlobalization extends TModule
* @param TXmlElement application configuration
*/
public function init($xml)
- {
+ {
$this->_defaultCharset = $this->getCharset();
$this->_defaultCulture = $this->getCulture();
@@ -82,7 +82,7 @@ class TGlobalization extends TModule
}
/**
- * @param string culture, e.g. <tt>en_US</tt> for American English
+ * @param string culture, e.g. <tt>en_US</tt> for American English
*/
public function setCulture($culture)
{
@@ -131,7 +131,7 @@ class TGlobalization extends TModule
if($config['type'] == 'XLIFF' || $config['type'] == 'gettext')
{
$config['source'] = Prado::getPathOfNamespace($config['source']);
- if(!is_dir($config['source']))
+ if($config['source']===null || !is_dir($config['source']))
throw new TException("invalid source dir '{$config['source']}'");
}
if($config['cache'])
@@ -154,7 +154,7 @@ class TGlobalization extends TModule
{
return $this->_translation['catalogue'] = $value;
}
-
+
/**
* @return string default charset set in application.xml
*/