From 8b9a5c2f0d5025e29a5477ea8cc8937db49b0341 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Sat, 18 Feb 2006 02:25:34 +0000
Subject: Fixed a security issue about usage of Prado::getPathOfNamespace.
---
framework/I18N/TGlobalization.php | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
(limited to 'framework/I18N')
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. en_US for American English
+ * @param string culture, e.g. en_US 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
*/
--
cgit v1.2.3