summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php14
-rw-r--r--framework/Exceptions/TErrorHandler.php45
-rw-r--r--framework/Util/TLogRouter.php12
-rw-r--r--framework/Web/Javascripts/source/prado/validator/validation3.js3
-rw-r--r--framework/Web/TAssetManager.php20
-rw-r--r--framework/Web/UI/WebControls/TBulletedList.php5
6 files changed, 95 insertions, 4 deletions
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
index 462b356f..f6e0acd5 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
@@ -712,6 +712,20 @@ class TSqlMapXmlMappingConfiguration extends TSqlMapXmlConfigBuilder
}
$cache = Prado::createComponent($cacheModel->getImplementationClass());
$this->setObjectPropFromNode($cache,$node,$properties);
+
+ foreach($node->xpath('property') as $propertyNode)
+ {
+ $name = $propertyNode->attributes()->name;
+ if($name===null || $name==='') continue;
+
+ $value = $propertyNode->attributes()->value;
+ if($value===null || $value==='') continue;
+
+ if( !TPropertyAccess::has($cache, $name) ) continue;
+
+ TPropertyAccess::set($cache, $name, $value);
+ }
+
$this->loadFlushInterval($cacheModel,$node);
$cacheModel->initialize($cache);
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php
index fa8e6d4a..3b5927d6 100644
--- a/framework/Exceptions/TErrorHandler.php
+++ b/framework/Exceptions/TErrorHandler.php
@@ -139,6 +139,33 @@ class TErrorHandler extends TModule
}
}
+
+ /**
+ * @param string $value
+ * @param Exception|null$exception
+ * @return string
+ * @since 3.1.6
+ */
+ protected static function hideSecurityRelated($value, $exception=null)
+ {
+ $aRpl = array();
+ if($exception !== null && $exception instanceof Exception)
+ {
+ $aTrace = $exception->getTrace();
+ foreach($aTrace as $item)
+ {
+ $file = $item['file'];
+ $aRpl[dirname($file) . DIRECTORY_SEPARATOR] = '<hidden>' . DIRECTORY_SEPARATOR;
+ }
+ }
+ $aRpl[$_SERVER['DOCUMENT_ROOT']] = '${DocumentRoot}';
+ $aRpl[str_replace('/', DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT'])] = '${DocumentRoot}';
+ $aRpl[PRADO_DIR . DIRECTORY_SEPARATOR] = '${PradoFramework}' . DIRECTORY_SEPARATOR;
+ $aRpl = array_reverse($aRpl, true);
+
+ return str_replace(array_keys($aRpl), $aRpl, $value);
+ }
+
/**
* Displays error to the client user.
* THttpException and errors happened when the application is in <b>Debug</b>
@@ -154,18 +181,30 @@ class TErrorHandler extends TModule
$content=$this->getErrorTemplate($statusCode,$exception);
$serverAdmin=isset($_SERVER['SERVER_ADMIN'])?$_SERVER['SERVER_ADMIN']:'';
- if($this->getApplication()->getMode()===TApplicationMode::Debug)
+
+ $isDebug = $this->getApplication()->getMode()===TApplicationMode::Debug;
+
+ $errorMessage = $exception->getMessage();
+ if($isDebug)
$version=$_SERVER['SERVER_SOFTWARE'].' <a href="http://www.pradosoft.com/">PRADO</a>/'.Prado::getVersion();
else
+ {
$version='';
+ $errorMessage = self::hideSecurityRelated($errorMessage, $exception);
+ }
$tokens=array(
'%%StatusCode%%' => "$statusCode",
- '%%ErrorMessage%%' => htmlspecialchars($exception->getMessage()),
+ '%%ErrorMessage%%' => htmlspecialchars($errorMessage),
'%%ServerAdmin%%' => $serverAdmin,
'%%Version%%' => $version,
'%%Time%%' => @strftime('%Y-%m-%d %H:%M',time())
);
- header("HTTP/1.0 $statusCode ".$exception->getMessage());
+
+ if($isDebug)
+ header("HTTP/1.0 $statusCode ".$exception->getMessage(), true, $statusCode);
+ else
+ header("HTTP/1.0 $statusCode", true, $statusCode);
+
echo strtr($content,$tokens);
}
diff --git a/framework/Util/TLogRouter.php b/framework/Util/TLogRouter.php
index cc736fae..a8f42b56 100644
--- a/framework/Util/TLogRouter.php
+++ b/framework/Util/TLogRouter.php
@@ -1046,6 +1046,18 @@ class TFirePhpLogRoute extends TLogRoute
{
if(empty($logs) || $this->getApplication()->getMode()==='Performance') return;
+ if( headers_sent() ) {
+ echo '
+ <div style="width:100%; background-color:darkred; color:#FFF; padding:2px">
+ TFirePhpLogRoute.GroupLabel "<i>' . $this -> getGroupLabel() . '</i>" -
+ Routing to FirePHP impossible, because headers already sent!
+ </div>
+ ';
+ $fallback = new TBrowserLogRoute();
+ $fallback->processLogs($logs);
+ return;
+ }
+
require_once Prado::getPathOfNamespace('System.3rdParty.FirePHPCore') . '/FirePHP.class.php';
$firephp = FirePHP::getInstance(true);
$firephp -> setOptions(array('useNativeJsonEncode' => false));
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js
index 850536ab..18b1d0c2 100644
--- a/framework/Web/Javascripts/source/prado/validator/validation3.js
+++ b/framework/Web/Javascripts/source/prado/validator/validation3.js
@@ -727,6 +727,9 @@ Prado.WebUI.TValidationSummary.prototype =
*/
formatMessageBox : function(messages)
{
+ if(this.options.DisplayMode == 'HeaderOnly' && this.options.HeaderText)
+ return this.options.HeaderText;
+
var output = this.options.HeaderText ? this.options.HeaderText + "\n" : "";
for(var i = 0; i < messages.length; i++)
{
diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php
index 7925d209..4abd1788 100644
--- a/framework/Web/TAssetManager.php
+++ b/framework/Web/TAssetManager.php
@@ -179,6 +179,24 @@ class TAssetManager extends TModule
}
/**
+ * @return array List of published assets
+ * @since 3.1.6
+ */
+ protected function getPublished()
+ {
+ return $this->_published;
+ }
+
+ /**
+ * @param $values List of published assets
+ * @since 3.1.6
+ */
+ protected function setPublished($values=array())
+ {
+ $this->_published = $values;
+ }
+
+ /**
* Returns the published path of a file path.
* This method does not perform any publishing. It merely tells you
* if the file path is published, where it will go.
@@ -269,7 +287,7 @@ class TAssetManager extends TModule
if(@filemtime($dst.DIRECTORY_SEPARATOR.$file)<@filemtime($src.DIRECTORY_SEPARATOR.$file))
{
@copy($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
- @chmod($dst.DIRECTORY_SEPARATOR.$file, PRADO_CHMOD);
+ @chmod($dst.DIRECTORY_SEPARATOR.$file, PRADO_CHMOD);
}
}
else
diff --git a/framework/Web/UI/WebControls/TBulletedList.php b/framework/Web/UI/WebControls/TBulletedList.php
index 60cf743e..5f4aa49c 100644
--- a/framework/Web/UI/WebControls/TBulletedList.php
+++ b/framework/Web/UI/WebControls/TBulletedList.php
@@ -103,6 +103,10 @@ class TBulletedList extends TListControl implements IPostBackEventHandler
$needStart=false;
switch($this->getBulletStyle())
{
+ case TBulletStyle::None:
+ $writer->addStyleAttribute('list-style-type','none');
+ $needStart=true;
+ break;
case TBulletStyle::Numbered:
$writer->addStyleAttribute('list-style-type','decimal');
$needStart=true;
@@ -452,6 +456,7 @@ class TBulletedListEventParameter extends TEventParameter
class TBulletStyle extends TEnumerable
{
const NotSet='NotSet';
+ const None='None';
const Numbered='Numbered';
const LowerAlpha='LowerAlpha';
const UpperAlpha='UpperAlpha';