summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TColorPicker.php
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/Web/UI/WebControls/TColorPicker.php
parentcba0c1b472cec22e4ffed2b3b084bea27cd26582 (diff)
Fixed a security issue about usage of Prado::getPathOfNamespace.
Diffstat (limited to 'framework/Web/UI/WebControls/TColorPicker.php')
-rw-r--r--framework/Web/UI/WebControls/TColorPicker.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/framework/Web/UI/WebControls/TColorPicker.php b/framework/Web/UI/WebControls/TColorPicker.php
index 2a19125b..c0cc3ae7 100644
--- a/framework/Web/UI/WebControls/TColorPicker.php
+++ b/framework/Web/UI/WebControls/TColorPicker.php
@@ -132,11 +132,15 @@ class TColorPicker extends TTextBox
{
$cs = $this->getPage()->getClientScript();
$style = 'System.Web.Javascripts.colorpicker.'.$this->getColorPickerStyle();
- $cssFile=Prado::getPathOfNamespace($style,'.css');
- $url = $this->publishFilePath($cssFile);
- if(!$cs->isStyleSheetFileRegistered($style))
- $cs->registerStyleSheetFile($style, $url);
- return $url;
+ if(($cssFile=Prado::getPathOfNamespace($style,'.css'))!==null)
+ {
+ $url = $this->publishFilePath($cssFile);
+ if(!$cs->isStyleSheetFileRegistered($style))
+ $cs->registerStyleSheetFile($style, $url);
+ return $url;
+ }
+ else
+ throw new TConfigurationException('colorpicker_style_invalid',$style);
}
/**
@@ -157,8 +161,10 @@ class TColorPicker extends TTextBox
foreach($images as $filename => $ext)
{
$image = 'System.Web.Javascripts.colorpicker.'.$filename;
- $file = Prado::getPathOfNamespace($image, $ext);
- $list[$filename.$ext] = $this->publishFilePath($file);
+ if(($file = Prado::getPathOfNamespace($image, $ext))!==null)
+ $list[$filename.$ext] = $this->publishFilePath($file);
+ else
+ throw new TConfigurationException('colorpicker_image_invalid',$image);
}
$imgs['button.gif'] = $list['button.gif'];
$imgs['background.png'] = $list['background.png'];