From 5dd4b52e6068294001d0669eebb88ac8e3481a97 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 23 Jan 2017 17:33:18 +0100 Subject: Update pradolite.php --- framework/pradolite.php | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/framework/pradolite.php b/framework/pradolite.php index 2c12c05f..37f93ec3 100644 --- a/framework/pradolite.php +++ b/framework/pradolite.php @@ -1,7 +1,7 @@ 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('&','&',$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('&','&',$url), true, $this->_status); + } else { + if($isIIS) + header('HTTP/1.1 302 '.self::$HTTP_STATUS_CODES[302]); header('Location: '.str_replace('&','&',$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 -- cgit v1.2.3