summaryrefslogtreecommitdiff
path: root/lib/prado/framework/pradolite.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-03-15 17:01:02 +0100
committeremkael <emkael@tlen.pl>2017-03-15 17:01:02 +0100
commit96481892cf693fa33d5f14a3ec6beaed26bd4485 (patch)
tree97601b9bc240d7994d09719a5819bf035af396e1 /lib/prado/framework/pradolite.php
parentc852b322361bb15771e19349c9e36a6f5a4616f2 (diff)
* bumping Prado version to 3.3.2-r5dd4b52
Diffstat (limited to 'lib/prado/framework/pradolite.php')
-rw-r--r--lib/prado/framework/pradolite.php27
1 files changed, 22 insertions, 5 deletions
diff --git a/lib/prado/framework/pradolite.php b/lib/prado/framework/pradolite.php
index 2c12c05..37f93ec 100644
--- a/lib/prado/framework/pradolite.php
+++ b/lib/prado/framework/pradolite.php
@@ -1,7 +1,7 @@
<?php
/**
* File Name: pradolite.php
- * Last Update: 2016/08/23 12:36:39
+ * Last Update: 2017/01/23 17:32:51
* Generated By: buildscripts/phpbuilder/build.php
*
* This file is used in lieu of prado.php to boost PRADO application performance.
@@ -3247,6 +3247,10 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar
{
return isset($_SERVER['SERVER_NAME'])?$_SERVER['SERVER_NAME']:null;
}
+ public function getServerSoftware()
+ {
+ return isset($_SERVER['SERVER_SOFTWARE'])?$_SERVER['SERVER_SOFTWARE']:null;
+ }
public function getServerPort()
{
return isset($_SERVER['SERVER_PORT'])?$_SERVER['SERVER_PORT']:null;
@@ -3862,12 +3866,25 @@ class THttpResponse extends TModule implements ITextWriter
public function httpRedirect($url)
{
$this->ensureHeadersSent();
+ $isIIS = (stripos($this->getRequest()->getServerSoftware(), "microsoft-iis") !== false);
if($url[0]==='/')
$url=$this->getRequest()->getBaseUrl().$url;
if ($this->_status >= 300 && $this->_status < 400)
- header('Location: '.str_replace('&amp;','&',$url), true, $this->_status);
- else
+ {
+ if($isIIS)
+ {
+ header('HTTP/1.1 ' . $this->_status . ' ' . self::$HTTP_STATUS_CODES[
+ array_key_exists($this->_status, self::$HTTP_STATUS_CODES)
+ ? $this->_status
+ : 302
+ ]);
+ }
+ header('Location: '.str_replace('&amp;','&',$url), true, $this->_status);
+ } else {
+ if($isIIS)
+ header('HTTP/1.1 302 '.self::$HTTP_STATUS_CODES[302]);
header('Location: '.str_replace('&amp;','&',$url));
+ }
if(!$this->getApplication()->getRequestCompleted())
$this->getApplication()->onEndRequest();
exit();
@@ -8854,7 +8871,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
else if($str[2]==='~')
$tpl[$c++]=array($container,array(TCompositeLiteral::TYPE_EXPRESSION,"\$this->publishFilePath('$this->_contextPath/$literal')"));
else if($str[2]==='/')
- $tpl[$c++]=array($container,array(TCompositeLiteral::TYPE_EXPRESSION,"rtrim(dirname(\$this->getApplication()->getRequest()->getApplicationUrl()), '/').'/$literal'"));
+ $tpl[$c++]=array($container,array(TCompositeLiteral::TYPE_EXPRESSION,"rtrim(dirname(\$this->getApplication()->getRequest()->getApplicationUrl()), '\/').'/$literal'"));
else if($str[2]==='[')
{
$literal=strtr(trim(substr($literal,0,strlen($literal)-1)),array("'"=>"\'","\\"=>"\\\\"));
@@ -9071,7 +9088,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
return array(self::CONFIG_PARAMETER,trim(substr($value,3,strlen($value)-5)));
elseif($value[2]==='/') {
$literal = trim(substr($value,3,strlen($value)-5));
- return array(self::CONFIG_EXPRESSION,"rtrim(dirname(\$this->getApplication()->getRequest()->getApplicationUrl()), '/').'/$literal'");
+ return array(self::CONFIG_EXPRESSION,"rtrim(dirname(\$this->getApplication()->getRequest()->getApplicationUrl()), '\/').'/$literal'");
}
}
else