diff --git a/CHANGELOG b/CHANGELOG index 233acb190b..7e83a71374 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ Yii Framework Change Log ======================== -Version 1.1.28 under development +Version 1.1.28 February 28, 2023 -------------------------------- - Bug #4484: Set Last-Modified after sending cache control headers (jannis701, wtommyw) diff --git a/framework/YiiBase.php b/framework/YiiBase.php index 19c0cf6003..02cb4fc066 100644 --- a/framework/YiiBase.php +++ b/framework/YiiBase.php @@ -87,7 +87,7 @@ class YiiBase */ public static function getVersion() { - return '1.1.28-dev'; + return '1.1.28'; } /** diff --git a/framework/yiilite.php b/framework/yiilite.php index 609e497d6d..0dfb197068 100644 --- a/framework/yiilite.php +++ b/framework/yiilite.php @@ -41,7 +41,7 @@ class YiiBase private static $_logger; public static function getVersion() { - return '1.1.28-dev'; + return '1.1.28'; } public static function createWebApplication($config=null) { @@ -2553,9 +2553,22 @@ protected function decodePathInfo($pathInfo) } else { - return utf8_encode($pathInfo); + return $this->utf8Encode($pathInfo); } } + private function utf8Encode($s) + { + $s.=$s; + $len=strlen($s); + for ($i=$len>>1,$j=0; $i<$len; ++$i,++$j) { + switch (true) { + case $s[$i] < "\x80": $s[$j] = $s[$i]; break; + case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break; + default: $s[$j] = "\xC3"; $s[++$j] = chr(ord($s[$i]) - 64); break; + } + } + return substr($s, 0, $j); + } public function getRequestUri() { if($this->_requestUri===null) @@ -4326,7 +4339,7 @@ public function logout($destroySession=true) if($this->identityCookie!==null) { $cookie=$this->createIdentityCookie($this->getStateKeyPrefix()); - $cookie->value=null; + $cookie->value=''; $cookie->expire=0; Yii::app()->getRequest()->getCookies()->add($cookie->name,$cookie); } @@ -5915,7 +5928,7 @@ public static function listData($models,$valueField,$textField,$groupField='') public static function value($model,$attribute,$defaultValue=null) { if(is_scalar($attribute) || $attribute===null) - foreach(explode('.',$attribute) as $name) + foreach(explode('.',(string)$attribute) as $name) { if(is_object($model)) { @@ -10443,9 +10456,9 @@ protected function validateAttribute($object,$attribute) return; } if(function_exists('mb_strlen') && $this->encoding!==false) - $length=mb_strlen($value, $this->encoding ? $this->encoding : Yii::app()->charset); + $length=mb_strlen((string)$value, $this->encoding ? $this->encoding : Yii::app()->charset); else - $length=strlen($value); + $length=strlen((string)$value); if($this->min!==null && $length<$this->min) { $message=$this->tooShort!==null?$this->tooShort:Yii::t('yii','{attribute} is too short (minimum is {min} characters).');