From fb81e9226d0073a1a80a9dd06fba0a6c5f626fc2 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Tue, 9 Oct 2007 12:57:07 +0000
Subject: removed version info when not in debug mode.
---
framework/Exceptions/TErrorHandler.php | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
(limited to 'framework/Exceptions')
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'].' PRADO/'.Prado::getVersion();
+ else
+ $version='';
$tokens=array(
'%%StatusCode%%' => "$statusCode",
'%%ErrorMessage%%' => htmlspecialchars($exception->getMessage()),
'%%ServerAdmin%%' => $serverAdmin,
- '%%Version%%' => $_SERVER['SERVER_SOFTWARE'].' PRADO/'.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'].' PRADO/'.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'].' PRADO/'.Prado::getVersion(),
+ '%%Version%%' => $version,
'%%Time%%' => @strftime('%Y-%m-%d %H:%M',time())
);
--
cgit v1.2.3