diff options
author | xue <> | 2007-10-09 12:57:07 +0000 |
---|---|---|
committer | xue <> | 2007-10-09 12:57:07 +0000 |
commit | fb81e9226d0073a1a80a9dd06fba0a6c5f626fc2 (patch) | |
tree | 2327b5eb1a2fdf69e3701ce38f27acc94f87e902 /framework/Exceptions | |
parent | d479bdcfb9190b54f0396352f2d663a311b140e9 (diff) |
removed version info when not in debug mode.
Diffstat (limited to 'framework/Exceptions')
-rw-r--r-- | framework/Exceptions/TErrorHandler.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index b98ade5e..0eeea9ce 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -154,11 +154,15 @@ class TErrorHandler extends TModule $content=$this->getErrorTemplate($statusCode,$exception);
$serverAdmin=isset($_SERVER['SERVER_ADMIN'])?$_SERVER['SERVER_ADMIN']:'';
+ if($this->getApplication()->getMode()===TApplicationMode::Debug)
+ $version=$_SERVER['SERVER_SOFTWARE'].' <a href="http://www.pradosoft.com/">PRADO</a>/'.Prado::getVersion();
+ else
+ $version='';
$tokens=array(
'%%StatusCode%%' => "$statusCode",
'%%ErrorMessage%%' => htmlspecialchars($exception->getMessage()),
'%%ServerAdmin%%' => $serverAdmin,
- '%%Version%%' => $_SERVER['SERVER_SOFTWARE'].' <a href="http://www.pradosoft.com/">PRADO</a>/'.Prado::getVersion(),
+ '%%Version%%' => $version,
'%%Time%%' => @strftime('%Y-%m-%d %H:%M',time())
);
echo strtr($content,$tokens);
@@ -227,13 +231,18 @@ class TErrorHandler extends TModule $source=$this->getSourceCode(@file($fileName),$errorLine);
}
+ if($this->getApplication()->getMode()===TApplicationMode::Debug)
+ $version=$_SERVER['SERVER_SOFTWARE'].' <a href="http://www.pradosoft.com/">PRADO</a>/'.Prado::getVersion();
+ else
+ $version='';
+
$tokens=array(
'%%ErrorType%%' => get_class($exception),
'%%ErrorMessage%%' => $this->addLink(htmlspecialchars($exception->getMessage())),
'%%SourceFile%%' => htmlspecialchars($fileName).' ('.$errorLine.')',
'%%SourceCode%%' => $source,
'%%StackTrace%%' => htmlspecialchars($exception->getTraceAsString()),
- '%%Version%%' => $_SERVER['SERVER_SOFTWARE'].' <a href="http://www.pradosoft.com/">PRADO</a>/'.Prado::getVersion(),
+ '%%Version%%' => $version,
'%%Time%%' => @strftime('%Y-%m-%d %H:%M',time())
);
|